Recursion in C++

The principles of recursion are the same, regardless of the language used for implementation. This chapter views the topic through the lens of C++. There are a fair number of examples and visualizations. Read through these at a minimum. You might find the exercises useful since the application of a principle is an aid to your understanding. Read Chapter 5 in this book on C++.

14. Discussion Questions

  1. Draw a call stack for the Tower of Hanoi problem. Assume that you start with a stack of three disks.

  2. Using the recursive rules as described, draw a Sierpinski triangle using paper and pencil.

  3. Using the dynamic programming algorithm for making change, find the smallest number of coins that you can use to make 33 cents in change. In addition to the usual coins assume that you have an 8 cent coin.