Simulation of other Paradigms and Continuations
- slide 40 : 43
Simultaneous traversal of two binary trees (2)
Here we provide the details of the two simultaneous tree traversals
Two simulutaneous traversals scheduled by a controller:
Start the controller
Start pre-order traversal of the first tree - hand back pair of first node and traversal continuation
Start pre-order traversal of the second tree - hand back pair of first node and traversal continuation
Form pair of nodes, and recur
Continue each of the traversals - hand back control continuations
The basic tree functions - together with two concrete trees.
The tree traversal functions.
The controller function.
Tree stuff, traversal, and controller - in one file.