Introduction: 10.3.0

  • We learned about recursion
    • A recursive method calls itself
      • It should have at least one way to stop this recursion
        • This is a base case

Concept Summary: 10.3.1

  • base case
    • A way to stop recursive calls
    • This returns a value instead of a recursive call
  • Call stack
    • The call stack keeps track of methods as they are called
    • It keeps track of local variables and where the call will return to
    • Calls can only be added to and popped off the top of the stack
  • recursive method
    • A method that contains at least one call to itself inside the method

Common Mistakes: 10.3.3

  • Missing the recursive call
    • Look for a call to the same method!
  • Getting confused about when a recursive method returns and what it returns
  • Assuming you understand what the recursion is doing without tracing the entire method call