Last active
October 30, 2017 11:56
-
-
Save Abhiroop/ca12f9016ba7cb30f96110f00aef8d1c to your computer and use it in GitHub Desktop.
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
balR :: Tree a -> Tree a | |
balR (T B t1 y (T R t2 x t3)) = T R t1 y (T B t2 x t3) | |
balR (T B (T B t1 z t2) y t3) = balance' (T B (T R t1 z t2) y t3) | |
balR (T B (T R t1@(T B l value r) z (T B t2 u t3)) y t4) = | |
T R (balance' (T B (T R l value r) z t2)) u (T B t3 y t4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment