previous | index | next

Interior Nodes

Nodes that are not leaves are called interior nodes. For example, node 2 is interior and has list representation:
     (2
      (1 () ())
      (3 () ()))
Q: How to create this tree?
A:   (make-nonempty-tree 2
                         (make-leaf 1)
                         (make-leaf 3))
The root 4 is also interior:
     (4
      (2
       (1 () ())
       (3 () ()))
      (6
       (5 () ())
       (7 () ())))
Q: How to create it?

previous | index | next