Understanding Recursion in Traversing Binary Trees

I had trouble understanding recursion in the section on traversing binary trees in Part 2 of the Data Structures & Algorithms Course. So I did some extra homework and found a couple resources that improved my understanding.

If you are also uncomfortable with recursion, I hope this helps:

  1. Recursion for Beginners: A Beginner’s Guide to Recursion
    Al Sweigart explains the role of the call stack in recursion (“to understand recursion, you must first understand stacks”), plus when to use recursion vs loops

  2. Recursion is not hard: a step-by-step walkthrough of this useful programming technique
    An excellent written explanation of the use of stacks in recursion

1 Like

A couple extra links:

  1. Introduction to Recursion (Data Structures & Algorithms #6)
    CS Dojo explains recursion using examples of factorials and Fibonacci’s number

  2. Tower of Hani Problem - Made Easy
    Abdul Bari explains the recursive solution to the famous Tower of Hanoi problem