Generic quicksort library that can be used to sort an array having any data type (int, char *, struct key_value *, etc.).

Collin Funk collin.funk1@gmail.com
Fri Sep 26 16:37:16 GMT 2025


Amit <amitchoudhary0523@gmail.com> writes:

> This is misleading. It is mergesort. It should have been called msort().
>
> Then there is one more issue - if memory allocation fails then it does
> "heapsort".
>
> But no quicksort out there.

There is no requirement that qsort uses quicksort. POSIX only requires
that it sorts the elements [1].

Collin

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/qsort.html


More information about the Libc-alpha mailing list