Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket
- (require racket/list)
- (provide (all-defined-out))
- (define (BST t level)
- (cond
- [(empty? (second t)) #/]
- [else (BST (second t) (+ 1 level))]
- )
- (display (~a (first t) #:min-width (* 4 level) #:align 'center))
- (newline)
- (cond
- [(empty? (third t)) ""]
- [else (BST (third t) (+ 1 level))]
- )
- )
- (BST '(1 (0 () ()) (10 (5 () ()) (17 (12 () ()) (20 (19 () ()) ())))) 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement