3 ms·
FWIW, qsort (despite its name) does not specify a quicksort be used. IIRC qsort will use a merge-sort on glibc when it can do so without growing the heap.
by aidenn0 3y ago
FWIW, qsort (despite its name) does not specify a quicksort be used.
IIRC qsort will use a merge-sort on glibc when it can do so without growing the heap.
- JdeBP 3y agoHowever FreeBSD qsort(), in both libc and libkern, is quicksort, falling back to insertion sort when there are fewer than 7 items.