OOP Tree Traversal Lab

COSC 2306: Data Programming - Recursive Step-through

Object Instance Map
Method Execution
def preorder(tree):
if tree:
print(tree.getRootVal())
preorder(tree.getLeftChild())
preorder(tree.getRightChild())

Call Stack Depth

Stack is empty

Console Output (Sequence)

Step through to see traversal output...

University of Houston • COSC 2306 Trees Lab