

InterviewSolution
Saved Bookmarks
1. |
How sorting is performed in Linked List |
Answer» Answer: Merge sort is often preferred for sorting a linked list. ... Note that we need a REFERENCE to head in MergeSort() as the below implementation changes next links to sort the linked LISTS (not DATA at the nodes), so the head NODE has to be changed if the data at the original head is not the smallest value in the linked list. |
|