好了。终于把3-way qsort完成标准优化了:)# Programming - 葵花宝典
a*n
1 楼
优化部分基本是抄的glibc qsort的,不过glibc的写得太烂了,只要了它的idea ...
1. median-3 pivot
2. 3-way partition with optimized tight inner loops
3. non-recursive, w/ log(n) stack, always finish shorter partition first
4. qsort + final insertion sort hybrid with THRESH=5
5. optimized tight inner loop for final insertion sort
1. median-3 pivot
2. 3-way partition with optimized tight inner loops
3. non-recursive, w/ log(n) stack, always finish shorter partition first
4. qsort + final insertion sort hybrid with THRESH=5
5. optimized tight inner loop for final insertion sort