3 ms·
Libc qsort() isn't quicksort in several of the popular libc implementations. For example, it's (usually) a merge sort in glibc. http://calmerthanyouare.org/201
by tyingq 7y ago
Libc qsort() isn't quicksort in several of the popular libc implementations. For example, it's (usually) a merge sort in glibc. http://calmerthanyouare.org/2013/05/31/qsort-shootout.html http://calmerthanyouare.org/2013/05/31/qsort-shootout.html
- ape4 7y agoInteresting. The man page just says "sort an array". https://linux.die.net/man/3/qsort https://linux.die.net/man/3/qsort
- mark-r 7y agoExactly. As long as you get the proper results within reasonable time and memory constraints, why should you care exactly which algorithm is used?
- marmada 7y agoMaybe it's interesting to know what qsort does under the hood? Maybe you don't know what qsort's time and memory constraints are unless you know the underlying algorithim. Obviously the sorting algorithim you use matters, so this post has some theoretical value.
- mark-r 7y agoCertainly it matters, but I'd expect a library implementation to have more research applied to it than I can do on my own.