Created
September 16, 2012 08:47
-
-
Save nrolland/3731642 to your computer and use it in GitHub Desktop.
insertbst
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
let rec insertBST x = function | |
| Leaf -> Branch(x , Leaf, Leaf) | |
| Branch(v, l, r) when x < v -> Branch(v, insertBST x l, r ) | |
| Branch(v, l, r) as b when x > v -> Branch(v, l, insertBST x r ) | |
| b -> b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment