Last active
October 30, 2017 11:58
-
-
Save Abhiroop/2fe7fa3d32a65ddb0a3bee9a75ab7719 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
balance :: Color -> Tree a -> a -> Tree a -> Tree a | |
balance B (T R (T R a x b) y c) z d = T R (T B a x b) y (T B c z d) | |
balance B (T R a x (T R b y c)) z d = T R (T B a x b) y (T B c z d) | |
balance B a x (T R (T R b y c) z d) = T R (T B a x b) y (T B c z d) | |
balance B a x (T R b y (T R c z d)) = T R (T B a x b) y (T B c z d) | |
balance color a x b = T color a x b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment