Skip to content

Apr 25: Tracing Recursion

Learning Objectives

After today's class, you should be able to:

  • Explain how a return statement works in a recursive function.
  • Describe the process of tracing a recursive function on paper.
  • Write a recursive method that returns results via a parameter.

Reminders

  • By Friday 11pm: Do the Week 14 reading and take Quiz11
  • By Friday 11pm: Finish and submit Lab 11 (on CodingBat)
  • By Monday 11pm: Submit HW 9 Part B (last 3 methods)

Lesson Outline

Tracing [40 min]

Writing [25 min]

HW9 Hints [10 min]

  • totalPointDiff(elim) – recursive traversal, starting with getFinalMatchup
  • buildSchedule(elim) – recursive traversal with a Map parameter for results
  • calculateRecords(t) – use a Set to keep track of the Matchups you've seen