Publisher review:Ll_Msort.C - Linked list mergesort Here's an example of how to sort a singly-linked list. I think it can be modified to sort a doubly-linked list, but it would get a bit more complicated. Note that this is a recursive method, but the recursion depth is limited to be proportional to the base 2 log of the length of the list, so it won't "run away" and blow the stack.
Ll_Msort.C is a C/C++ script for Snippets scripts design by Bob Stout.
It runs on following operating system: Windows / Linux / BSD / Solaris.
Operating system:Windows / Linux / BSD / Solaris