Created
October 2, 2011 21:21
-
-
Save swannodette/1257981 to your computer and use it in GitHub Desktop.
redblacknew.cljs
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 balance [node] | |
(match [node] | |
[([:black [:red [:red a x b] y c] z d] | | |
[:black [:red a x [:red b y c]] z d] | | |
[:black a x [:red [:red b y c] z d]] | | |
[:black a x [:red b y [:red c z d]]])] [:red [:black a x b] y [:black c z d]] | |
:else node)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment