|
|
Simultaneous traversal of two binary trees (2) |
Here we provide the details of the two simultaneous tree traversals |
|
Notice the constructors make-tree and leaf; The accessors root, left-tree and right-tree; and the predicates inner-node?, leaf?, and empty-tree.
Even if fully within the functional paradigm, the inspiration from OOP is clear: Hide the representatinon of the tree from the application/client. |