Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (list->pnp-tree los)
- (cond
- [(empty? los) empty]
- [(and (list? (third los))(list? (second los)))
- (make-pnp-tree (first los) (list->pnp-tree (second los)) (list->pnp-tree (third los)))]
- [(list? (second los)) (make-pnp-tree (first los) (list->pnp-tree (second los)) (third los))]
- [(list? (third los)) (make-pnp-tree (first los) (second los) (list->pnp-tree (third los)))]
- [else (make-pnp-tree (first los) (second los) (third los))]
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement