dsa1 min read
Odd Even Linked List — Two Chain In-Place
Group all odd-indexed nodes before even-indexed nodes in O(n) time and O(1) space using two pointer chains.
Read →
1575 articles
Group all odd-indexed nodes before even-indexed nodes in O(n) time and O(1) space using two pointer chains.
Rotate a linked list to the right by k places by finding length, computing effective rotation, and rewiring.
Reorder a linked list into L0→Ln→L1→Ln-1 pattern by splitting at middle, reversing second half, then merging.
Add two numbers represented as reversed linked lists by simulating digit addition with carry propagation.
Add two numbers given in forward order by pushing digits to stacks, then building the result list in reverse.