Advertisement
HeroBaga

Untitled

Oct 21st, 2021
3,243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 0.42 KB | None | 0 0
  1. #lang racket
  2. (require racket/list)
  3. (provide (all-defined-out))
  4. (define (BST t level)
  5.   (cond
  6.     [(empty? (second t)) #/]
  7.     [else (BST (second t) (+ 1 level))]
  8.   )
  9.       (display (~a (first t)  #:min-width (* 4 level) #:align 'center))
  10.     (newline)
  11.    
  12.   (cond
  13.     [(empty? (third t)) ""]
  14.     [else (BST (third t) (+ 1 level))]
  15.   )
  16. )
  17.  
  18.  
  19.  
  20. (BST '(1 (0 () ()) (10 (5 () ()) (17 (12 () ()) (20 (19 () ()) ())))) 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement