Created
December 3, 2020 10:10
-
-
Save mxrnx/301229cf5c339a3dc9bedbeddf389acb to your computer and use it in GitHub Desktop.
quicksort in Arc
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
(def qs (seq) | |
(if (empty seq) nil | |
(let pivot (car seq) | |
(join (qs (keep [< _ pivot] (cdr seq))) | |
(list pivot) | |
(qs (keep [>= _ pivot] (cdr seq))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment