Topical Information

This set of labs should help you firm up your knowledge of recursion.

Core Choices

  1. Do Programming Exercises P13.1, P13.2, and P13.3 all in one program for (Level 2). Call the various implementations by their details — reverse_rec, reverse_with_help and reverse_helper, and reverse_iter, for instance.

  2. Do Programming Exercises P13.4 and P13.5 for (Level 2).

  3. Do Programming Exercises P13.6 and P13.7 for (Level 2).

  4. Do Programming Exercise P13.8 for (Level 2). (And don't worry, you can cut any polygon into n triangles and not have anything left over. This can be proven by induction, in fact. Try it for another (Level 1.5).)

  5. Do Programming Exercises P13.9 and P13.10 for (Level 3).

  6. Do Programming Exercise P13.11 for (Level 3). Compare/Contrast this with an implementation such as described in P13.12 for an additional (Level 2).

  7. Do Programming Exercise P13.13 for (Level 3).

    I'll add in another (Level 2) to put this together with Programming Project 13.2. Have the move string displayed under your peg display as a sort of caption.

  8. Do Programming Exercise P13.14 for (Level 3). Indeed, getting the path to print is worth an extra (Level 2).

  9. Do Programming Exercise P13.15 for (Level 3).

  10. Do Programming Exercise P13.16 for (Level 2). Be careful when making your timing comparisons. The iterative version can at first appear faster. Make sure you test calculating, for instance, all Fibonacci numbers from 10 down to 0 — in that order.


Your target level for this lab set is (Level 8). Please, choose from the core choices to meet this goal. After you've met it, you may decide to improve the level total by selecting from other core choices or from the boosters below.

Boosters