Use a second argument on which to cons nodes as you encounter them:
(define preorder
(lambda (tree)
(preorder-onto tree '())))
(define preorder-onto
(lambda (tree list)
(if (empty-tree? tree)
list
(cons (root tree)
__?__ ))))
|
|