Skip to content

Instantly share code, notes, and snippets.

@trung
Created November 6, 2009 08:22
Show Gist options
  • Save trung/227835 to your computer and use it in GitHub Desktop.
Save trung/227835 to your computer and use it in GitHub Desktop.
% Quick sort
-module (recursion).
-export ([qsort/1]).
qsort([]) -> [];
qsort([Pivot|T]) ->
qsort([X || X <- T, X < Pivot])
++ [Pivot] ++
qsort([X || X <- T, X >= Pivot]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment