dsa1 min read
Swap Nodes in Pairs — In-Place Pointer Rewiring
Swap every two adjacent nodes in a linked list without modifying node values using pointer rewiring.
Read →
webcoderspeed.com
4 articles
Swap every two adjacent nodes in a linked list without modifying node values using pointer rewiring.
Group all odd-indexed nodes before even-indexed nodes in O(n) time and O(1) space using two pointer chains.
Reverse the portion of a linked list between positions left and right in one pass using careful pointer manipulation.
Flatten a binary tree in-place into a linked list following pre-order using the Morris traversal approach.