News for hackers. Stuff that matters.
Re:Quadsort: a stable non-recursive merge sort by jph on Thursday February 13, 2020 @08:41PM (#22323256)
Summary: this is a non-recursive merge sort with improvements.

Benchmark of quadsort() versus C qsort():

* ~10x faster on forward-order items

* ~2x faster on reverse-order items

* ~equivalent on random-order items

Improvements:

* Ordering: when blocks of items are in order, or in reverse-order, then do special case handling, which gives quadsort O(n + log n) instead of qsort O(n * log n).

* Boundaries: compare data rather than traditional merge sort wasteful boundary checks.

Re:Quadsort: a stable non-recursive merge sort by eru on Friday February 14, 2020 @12:23AM (#22324157)
If you have a k sorted (or reverse sorted) blocks, you can get O(n log k) performance in merge sort variants. Especially, if k is a small fixed constant, like 1 or 2 or 10, you should get linear performance.

A few language's standard library sorts implement that already.

For a serious implementation, of course, you not only care about the asymptotic performance, but also absolute runtimes.

Re:Quadsort: a stable non-recursive merge sort by chalst on Friday February 14, 2020 @12:54AM (#22324276)
Good summary. Quibble: O(n + log n) = O(n).
Re:Quadsort: a stable non-recursive merge sort by kannmig on Friday February 14, 2020 @01:40AM (#22324453)
I think OP made the distinction intentional to “show their working”, so to speak.