OOP Tree Traversal Lab
COSC 2306: Data Programming - Recursive Step-through
PREORDER
INORDER
POSTORDER
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
← Previous
Next Step →
Reset Simulation
Console Output (Sequence)
Step through to see traversal output...
University of Houston • COSC 2306 Trees Lab