summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/qsort.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/qsort.3')
-rw-r--r--lib/libc/stdlib/qsort.312
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3
index a23301f..a734da2 100644
--- a/lib/libc/stdlib/qsort.3
+++ b/lib/libc/stdlib/qsort.3
@@ -97,7 +97,9 @@ objects, the initial member of which is pointed to by
.Fa base .
The size of each object is specified by
.Fa size .
-.Fn Mergesort
+The
+.Fn mergesort
+function
behaves similarly, but
.Em requires
that
@@ -179,7 +181,9 @@ requires additional memory of size
.Fa nmemb *
.Fa size
bytes; it should be used only when space is not at a premium.
-.Fn Mergesort
+The
+.Fn mergesort
+function
is optimized for data with pre-existing order; its worst case
time is O N lg N; its best case is O N.
.Pp
@@ -218,9 +222,11 @@ argument to
is less than
.Dq "sizeof(void *) / 2" .
.It Bq Er ENOMEM
-.Fn Heapsort
+The
+.Fn heapsort
or
.Fn mergesort
+functions
were unable to allocate memory.
.El
.Sh COMPATIBILITY
OpenPOWER on IntegriCloud