June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,7 @@
|
|||
fun quicksort [] = []
|
||||
| quicksort (x::xs) =
|
||||
let
|
||||
val (left, right) = List.partition (fn y => y<x) xs
|
||||
in
|
||||
quicksort left @ [x] @ quicksort right
|
||||
end
|
||||
|
|
@ -1,17 +1,3 @@
|
|||
fun quicksort [] = []
|
||||
| quicksort (x::xs) =
|
||||
let
|
||||
val (left, right) = List.partition (fn y => y<x) xs
|
||||
in
|
||||
quicksort left @ [x] @ quicksort right
|
||||
end
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Solution 2:
|
||||
|
||||
Without using List.partition
|
||||
|
||||
fun par_helper([], x, l, r) = (l, r) |
|
||||
par_helper(h::t, x, l, r) =
|
||||
if h <= x then
|
||||
Loading…
Add table
Add a link
Reference in a new issue