Activity 01
Pair Programming: Traversal Coders
Pairs sketch a binary tree, then implement recursive in-order, pre-order, and post-order functions in Python. They input the tree and print outputs side-by-side for comparison. Pairs swap code with another duo to test and discuss differences.
Differentiate the output of in-order, pre-order, and post-order traversals on the same binary tree.
Facilitation TipDuring Pair Programming: Traversal Coders, run through one traversal together as a class first to model collaboration and debugging strategies before pairing begins.
What to look forPresent students with a small, pre-drawn binary tree. Ask them to write down the sequence of nodes visited for each traversal type: in-order, pre-order, and post-order. This checks their ability to apply the traversal rules.