Created
December 29, 2015 21:41
-
-
Save maruks/a4955274d54bbddaa358 to your computer and use it in GitHub Desktop.
quick sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qsort([]) -> | |
[]; | |
qsort([H | T]) -> | |
L = [E || E <- T, E < H], | |
R = [E || E <- T, E > H], | |
P = [E || E <- T, E =:= H], | |
qsort(L) ++ [H | P] ++ qsort(R). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment