Series overview

Python Bakery

Recursion and trees

This lesson introduces recursion, where a function calls itself on a smaller version of its input until it reaches a base case, and binary trees defined with dataclasses and inheritance. Students learn to trace and write recursive functions that process a tree’s nodes, following the branch, recursive call, and combination structure.