Without getting into details, suppose that we have the following procedures:
(define draw-tree (lambda (tree) (let ((dc ...) ;; Set up a "drawing context" and determine the (root-location ...)) ;; location of the root in the drawing area (define draw-tree-preorder (lambda (tree location) (draw-node tree location dc) (let ((left (left-subtree tree)) (right (right-subtree tree))) (if (not (empty-tree? left)) (begin (draw-left-link tree location dc) (draw-tree-preorder left (left-child-location tree location)))) (if (not (empty-tree? right)) (begin (draw-right-link tree location dc) (draw-tree-preorder right (right-child-location tree location)))) )) (draw-tree-preorder tree root-location))))