Created
January 7, 2015 10:01
-
-
Save bgmarx/b2b1e22947e24273241a to your computer and use it in GitHub Desktop.
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
(defn merge-sort [a-seq] | |
(cond (empty? a-seq) a-seq | |
(singleton? a-seq) a-seq | |
:else (let [[a b] (halve a-seq)] | |
(seq-merge (merge-sort a) | |
(merge-sort b))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment