Lecture overview -- Keyboard shortcut: 'u'  Previous page: A simpel producer and consumer -- Keyboard shortcut: 'p'  Next page: Simultaneous traversal of two binary trees (2) -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 3 - Page 39 : 43
Programming Paradigms
Simulation of other Paradigms and Continuations
Simultaneous traversal of two binary trees (1)

Simulating parallel pre-order traversals of two binary trees

The traversals gives rise to a list of node pairs from the two trees

Two binary trees together with the results of the simultaneous traversals

  • Overall approach

    • Nodes are passed from each traversal to a controller - via (heavy) use of continuations

    • Continuations are exchanged in between the controller and the recursive tree traversals

    • The recursive tree traversals carry the controller continuations arround