What’s the fastest algorithm for sorting a linked list?
It is reasonable to expect that you cannot do any better than O(N log N) in running time. However, the interesting part is to investigate whether you can sort it in-place, stably, its worst-case behavior and so on. Simon Tatham, of Putty fame, explains how to sort a linked list with merge sort. He concludes … Read more