|
@ -33,7 +33,7 @@ |
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
|
.\" SUCH DAMAGE. |
|
|
.\" SUCH DAMAGE. |
|
|
.\" |
|
|
.\" |
|
|
.\" $OpenBSD: qsort.3,v 1.6 2000/08/09 15:51:21 aaron Exp $ |
|
|
|
|
|
|
|
|
.\" $OpenBSD: qsort.3,v 1.7 2001/10/29 18:10:49 deraadt Exp $ |
|
|
.\" |
|
|
.\" |
|
|
.Dd June 4, 1993 |
|
|
.Dd June 4, 1993 |
|
|
.Dt QSORT 3 |
|
|
.Dt QSORT 3 |
|
@ -125,13 +125,9 @@ algorithm, |
|
|
a variant of selection sorting; in particular, see D.E. Knuth's Algorithm H. |
|
|
a variant of selection sorting; in particular, see D.E. Knuth's Algorithm H. |
|
|
.Fn heapsort |
|
|
.Fn heapsort |
|
|
takes O N lg N worst-case time. |
|
|
takes O N lg N worst-case time. |
|
|
Its |
|
|
|
|
|
.Em only |
|
|
|
|
|
advantage over |
|
|
|
|
|
|
|
|
This implementation of |
|
|
.Fn qsort |
|
|
.Fn qsort |
|
|
is that it uses almost no additional memory; while |
|
|
|
|
|
.Fn qsort |
|
|
|
|
|
does not allocate memory, it is implemented using recursion. |
|
|
|
|
|
|
|
|
is implemented without recursive function calls. |
|
|
.Pp |
|
|
.Pp |
|
|
The function |
|
|
The function |
|
|
.Fn mergesort |
|
|
.Fn mergesort |
|
|