Last active
December 18, 2015 10:19
-
-
Save grauwoelfchen/5767855 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
(define (bst-insert e bst) | |
(cond | |
[(t-empty? bst) (t-node e t-empty t-empty)] | |
[(< e (t-value bst)) | |
(t-node | |
(t-value bst) | |
(bst-insert e (t-left bst)) | |
(t-right bst))] | |
[else | |
(t-node | |
(t-value bst) | |
(t-left bst) | |
(bst-insert e (t-right bst)))] )) | |
(print (bst-insert 4 my-tree)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment