Stable Variant of Quick Sort.
import nxt.random_ex : randInPlace; immutable n = 2^^16; auto a = new int[n]; a.randInPlace(); auto b = a.dup; a[].stableSort; import std.algorithm: sort; sort(b); assert(a == b);
http://forum.dlang.org/thread/gjuvmrypvxeebvztszpr@forum.dlang.org
See Implementation
Stable Variant of Quick Sort.