Algorithm - Quick sort (C, qsort)
1 | void qsort (void *base, size_t nel, size_t width, int (*compare)(const void *, const void *); |
stdlib.h
O(nlogn)
(최악:O(n^2)
)
Example
1 |
|
- input
1 | 10 |
- output
1 | 1 1 2 3 4 5 6 7 8 9 |
1 | void qsort (void *base, size_t nel, size_t width, int (*compare)(const void *, const void *); |
stdlib.h
O(nlogn)
(최악: O(n^2)
)1 |
|
1 | 10 |
1 | 1 1 2 3 4 5 6 7 8 9 |