Created
November 30, 2015 13:43
-
-
Save ruandao/45965419668fbb34102d to your computer and use it in GitHub Desktop.
2.66
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
;#lang planet neil/sicp | |
#lang racket | |
(require (planet soegaard/sicp:2:1/sicp)) | |
(define wave einstein) | |
(define (lookup key bt-data) | |
(cond ((empty? bt-data) false) | |
((> key (key-of-root bt-data)) (lookup key (right-branch bt-data))) | |
((= key (key-of-root bt-data)) (entry-of-root bt-data)) | |
((< key (key-of-root bt-data)) (lookup key (left-branch bt-data))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment