summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/qsort.3
diff options
context:
space:
mode:
authoraaron <>2000-04-20 13:50:03 +0000
committeraaron <>2000-04-20 13:50:03 +0000
commita4336f357f9e30dffdfad4909b24bd2e82c096a2 (patch)
treec79a224a41eb2c48668c4b4eda84163d7daadf64 /src/lib/libc/stdlib/qsort.3
parent92b3e44bedaf5a5f85880565a47206cdbf9bfa2a (diff)
downloadopenbsd-a4336f357f9e30dffdfad4909b24bd2e82c096a2.tar.gz
openbsd-a4336f357f9e30dffdfad4909b24bd2e82c096a2.tar.bz2
openbsd-a4336f357f9e30dffdfad4909b24bd2e82c096a2.zip
Flesh out stdlib function man pages.
Diffstat (limited to 'src/lib/libc/stdlib/qsort.3')
-rw-r--r--src/lib/libc/stdlib/qsort.322
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/libc/stdlib/qsort.3 b/src/lib/libc/stdlib/qsort.3
index 8d665187bf..632909dd3c 100644
--- a/src/lib/libc/stdlib/qsort.3
+++ b/src/lib/libc/stdlib/qsort.3
@@ -33,7 +33,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: qsort.3,v 1.4 1999/06/29 18:36:22 aaron Exp $ 36.\" $OpenBSD: qsort.3,v 1.5 2000/04/20 13:50:02 aaron Exp $
37.\" 37.\"
38.Dd June 4, 1993 38.Dd June 4, 1993
39.Dt QSORT 3 39.Dt QSORT 3
@@ -105,7 +105,9 @@ is stable.
105.Pp 105.Pp
106The 106The
107.Fn qsort 107.Fn qsort
108function is an implementation of C.A.R. Hoare's ``quicksort'' algorithm, 108function is an implementation of C.A.R. Hoare's
109.Dq quicksort
110algorithm,
109a variant of partition-exchange sorting; in particular, see D.E. Knuth's 111a variant of partition-exchange sorting; in particular, see D.E. Knuth's
110Algorithm Q. 112Algorithm Q.
111.Fn qsort 113.Fn qsort
@@ -115,7 +117,9 @@ O N**2 worst-case behavior.
115.Pp 117.Pp
116The 118The
117.Fn heapsort 119.Fn heapsort
118function is an implementation of J.W.J. William's ``heapsort'' algorithm, 120function is an implementation of J.W.J. William's
121.Dq heapsort
122algorithm,
119a variant of selection sorting; in particular, see D.E. Knuth's Algorithm H. 123a variant of selection sorting; in particular, see D.E. Knuth's Algorithm H.
120.Fn heapsort 124.Fn heapsort
121takes O N lg N worst-case time. 125takes O N lg N worst-case time.
@@ -143,13 +147,11 @@ is faster than
143.Fn mergesort 147.Fn mergesort
144is faster than 148is faster than
145.Fn heapsort . 149.Fn heapsort .
146Memory availability and pre-existing order in the data can make this 150Memory availability and pre-existing order in the data can make this untrue.
147untrue.
148.Sh RETURN VALUES 151.Sh RETURN VALUES
149The 152The
150.Fn qsort 153.Fn qsort
151function 154function returns no value.
152returns no value.
153.Pp 155.Pp
154Upon successful completion, 156Upon successful completion,
155.Fn heapsort 157.Fn heapsort
@@ -167,8 +169,7 @@ function succeeds unless:
167.It Bq Er EINVAL 169.It Bq Er EINVAL
168The 170The
169.Fa size 171.Fa size
170argument is zero, or, 172argument is zero, or, the
171the
172.Fa size 173.Fa size
173argument to 174argument to
174.Fn mergesort 175.Fn mergesort
@@ -228,6 +229,5 @@ This is no longer true.
228.Sh STANDARDS 229.Sh STANDARDS
229The 230The
230.Fn qsort 231.Fn qsort
231function 232function conforms to
232conforms to
233.St -ansiC . 233.St -ansiC .