Find the middle node using slow/fast pointers.
Split the list into two halves.
Recursively sort each half.
Merge the sorted halves.
Unlike arrays, splitting a linked list is but doesn't require extra space. The merge step is also in-place.
Find the middle node using slow/fast pointers.
Split the list into two halves.
Recursively sort each half.
Merge the sorted halves.
Unlike arrays, splitting a linked list is but doesn't require extra space. The merge step is also in-place.