Sorting algorithms/Quicksort: Difference between revisions
m
Switch to header template
No edit summary |
m (Switch to header template) |
||
Line 164:
qsort (x:xs) = qsort ys ++ x : qsort zs where (ys, zs) = partition (<= x) xs
==
IDL has a powerful optimized <tt>sort()</tt> built-in. The following is thus merely for demonstration.
Line 180 ⟶ 178:
-5 3 12 17 99
==
fn quickSort arr =
(
Line 211 ⟶ 208:
a = quickSort a
==
def quickSort(arr):
less = []
Line 235 ⟶ 231:
a = quickSort(a)
==
<pre>
const proc: quickSort (inout array elemType: arr, in integer: left, in integer: right) is func
|