Created
July 23, 2017 17:09
-
-
Save memclutter/f52a6c5c3d68f669e680ced4278244f0 to your computer and use it in GitHub Desktop.
Implementation of quick sorting on erlang
This file contains hidden or 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
-module(qsort). | |
-export([qsort/1]). | |
% Implementation of quick sorting on erlang | |
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