Skip to content

Instantly share code, notes, and snippets.

@StoneCypher
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save StoneCypher/55563649ee1e698a451b to your computer and use it in GitHub Desktop.

Select an option

Save StoneCypher/55563649ee1e698a451b to your computer and use it in GitHub Desktop.
whoops forgot to set the highlighting language
qs( [] ) -> % this says "quicksort when called with an empty list"
[];
qs( [FirstItem | ListRemainder] ) ->
SmallerThanFirst = fun(X) -> X < FirstItem end,
{Smaller, LargerOrEq} = lists:partition(SmallerThanFirst, ListRemainder),
qs(Smaller) ++ [FirstItem] ++ qs(Larger).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment