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

Amit amitchoudhary0523@gmail.com
Fri Sep 26 16:59:03 GMT 2025


On Fri, Sep 26, 2025, 10:07 PM Collin Funk <collin.funk1@gmail.com> wrote:

> 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


This is fine with me. But then why name it qsort(). Why not call it sort().

Anyways, anyone who sees qsort() will assume that it is quicksort.

Anyways, there is no point in debating about the name of the function.

----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20250926/06c0dda9/attachment-0001.htm>


More information about the Libc-alpha mailing list