about summary refs log tree commit diff
path: root/src/stdlib/qsort.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-08-10 15:35:13 +0200
committerRich Felker <dalias@aerifal.cx>2017-08-11 20:23:21 -0400
commit52cf5c18f4ad3a7a59fb7113cf115c6fc05c7494 (patch)
tree8ae1ab526509c9b7f150b5e116884019373e6f8c /src/stdlib/qsort.c
parentdc2f368e565c37728b0d620380b849c3a1ddd78f (diff)
downloadmusl-52cf5c18f4ad3a7a59fb7113cf115c6fc05c7494.tar.gz
musl-52cf5c18f4ad3a7a59fb7113cf115c6fc05c7494.tar.xz
musl-52cf5c18f4ad3a7a59fb7113cf115c6fc05c7494.zip
qsort: add a short comment about the algorithm
Diffstat (limited to 'src/stdlib/qsort.c')
-rw-r--r--src/stdlib/qsort.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
index 434d9350..da58fd31 100644
--- a/src/stdlib/qsort.c
+++ b/src/stdlib/qsort.c
@@ -21,6 +21,9 @@
 
 /* Minor changes by Rich Felker for integration in musl, 2011-04-27. */
 
+/* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
+   Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
+
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>