To merge sort a linked list, do the following:
Make log n passes through the list. In each pass, combine each
adjacent pair of smaller sorted lists into one larger sorted list.
Each pass is O(n), and doubles the length of the sorted lists. Thus,
after log n passes, the list of n items is sorted.
For a more detailed description, see:
http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
Don

On Mar 24, 3:25 am, Sambhavna Singh <[email protected]> wrote:
> can anyone explain vividly how we can use merge sort here. thank you.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to