QuickSort on Doubly Linked List – Searching and sorting -. The idea is simple, we first find out pointer to last node. Once we have pointer to last node, we can recursively sort the linked list using pointers to first and last nodes of linked list.
Linked Lists
3 Articles
3
QuickSort on Singly Linked List – Searching and sorting – Quick Sort on Doubly Linked List is discussed here.In Singly linked list was given as an exercise. Following is C++ implementation for same.
Merge Sort for Linked Lists – Searching and Sorting – Merge sort is often preferred for sorting a linked list. The slow random-access performance of a linked list makes some other algorithms (such as quicksort) perform poorly, and others (such as heapsort) completely impossible.