Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ qsort(3C) — sysv — mips UMIPS RISC/os 4.52

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

bsearch(3C)

lsearch(3C)

string(3C)

sort(1)



QSORT(3C-SysV)      RISC/os Reference Manual       QSORT(3C-SysV)



NAME
     qsort - quicker sort

SYNOPSIS
     #include <bsd/sys/types.h>

     void qsort ((char *) base, nel, sizeof (*base), compar)
     unsigned nel;
     int (*compar)( );

DESCRIPTION
     qsort is an implementation of the quicker-sort algorithm.
     It sorts a table of data in place.

     base points to the element at the base of the table.  nel is
     the number of elements in the table.  compar is the name of
     the comparison function, which is called with two arguments
     that point to the elements being compared.  As the function
     must return an integer less than, equal to, or greater than
     zero, so must the first argument to be considered be less
     than, equal to, or greater than the second.

NOTES
     The pointer to the base of the table should be of type
     pointer-to-element, and cast to type pointer-to-character.

     The comparison function need not compare every byte, so
     arbitrary data may be contained in the elements in addition
     to the values being compared.

     The order in the output of two items which compare as equal
     is unpredictable.

SEE ALSO
     bsearch(3C), lsearch(3C), string(3C).
     sort(1) in the User's Reference Manual.



















                         Printed 1/15/91                   Page 1



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026