digitalmars.D - Sort for forward ranges
- Xinok (9/9) Mar 08 2012 This is a simple library I wro...
This is a simple library I wrote for sorting forward ranges. It's an in-place unstable sort which uses a combination of quick sort and comb sort. It's about 2-3x slower than the Phobos unstable sort. The down side of using quick sort is choosing a pivot. Rather than walk the range to do a median-of-three or other trick, I simply use the first element as the pivot. Instead, the code will fall back to comb sort to avoid the worst-case of quick sort. http://www.mediafire.com/?yy8p5xzg8ka38rd
Mar 08 2012