Skip to content

Instantly share code, notes, and snippets.

@bgmarx
Created January 7, 2015 10:01
Show Gist options
  • Save bgmarx/b2b1e22947e24273241a to your computer and use it in GitHub Desktop.
Save bgmarx/b2b1e22947e24273241a to your computer and use it in GitHub Desktop.
(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