Skip to content

Instantly share code, notes, and snippets.

@smallgeek
Created August 26, 2012 08:04
Show Gist options
  • Select an option

  • Save smallgeek/3475989 to your computer and use it in GitHub Desktop.

Select an option

Save smallgeek/3475989 to your computer and use it in GitHub Desktop.
NaturalSpec_Tutorial_6_3
/// クイックソートの単純な実装 – 真似しないように
let rec quicksort = function
| [] -> []
| pivot :: rest ->
let small,big = List.partition ((>) pivot) rest
quicksort small @ [pivot] @ quicksort big
let QuickSort x =
printMethod ""
quicksort x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment