Reorder Linked List ​
Reorder Linked List — LeetCode
Reorder a list L0 -> L1 -> ... -> Ln into L0 -> Ln -> L1 -> Ln-1 -> ... by rearranging the nodes themselves.
Approach ​
- Find Middle using Floyd's Rabbit and Turtle Algorithm
- Split the list at right midpoint) start $r$ and $t$ at head)
- Reverse right half
- Carefully join back
Remarks ​
I made a lot of fumbles while joining back