Python Arena

Module 48

More recursion examples

Where recursion really shines. Binary trees built from a small Node class, recursive algorithms that count, add up and measure them, a sorted binary tree you can search and add to, and data nested to any depth.

Steps

  1. Binary trees
  2. Sums, the smallest value and depth
  3. A sorted binary tree
  4. When loops get clumsy