qsort is a C standard library function that implements a polymorphic sorting algorithm for arrays of arbitrary objects according to a user-provided comparison function. It is named after the quicksort algorithm, which was originally used to implement it in the Unix C library, although the C standard does not require it to implement quicksort.
Implementations of the
qsort function achieve polymorphism by taking a function pointer to a comparison function, as well as a parameter that specifies the size of its individual input objects. The C standard requires the comparison function to implement a total order on the items in the input array.
- Bentley, Jon L.; McIlroy, M. Douglas (1993). "Engineering a sort function". Software—Practice and Experience 23 (11): 1249–1265.
- ISO/IEC 9899:201x, Programming Languages—C (draft). §7.22.5. November 16, 2010.
|This software engineering–related article is a stub. You can help Wikipedia by expanding it.|