An implanentation of C library function qsort()
which is based on Quick Sort algorithm and falls back to Insertion Sort when the interval have few elements and falls back to Heap Sort when recursive too deep.
Just #include <qsort.h>
and use the function _qsort()
to reaplce the C-library version of qsort()
.
Usually runs faster than qsort()
when n = 400000 on my machine (Ubuntu 18.04 LTS on a Surface Book with Performance Base(i7-6600U)).
Obviously runs slower than std::sort()
.