Sorting algorithms/Selection sort: Difference between revisions

Line 1,384:
| selection_sort (first::lst) =
let
fun select_rval (small ([], output) = small :: selection_sort outputfoldl
| select_r small(fn (x::xs, (small, output)) = >
if x < small then
select_r x (xsx, small::output)
else
select_r small (xssmall, x::output)
) (first, []) lst
in
select_rsmall first:: (lst,selection_sort [])output
end</lang>
 
Anonymous user