Outline



Implementation of Recursion



Recursion instead of loops



Recursion structure



Breaking up a problem



recursive thinking: Binary Search



Binary Search Implementation



Proving that a recursive method terminates



Details: comparing objects



example: print an integer



Reminder: how does recursion work?



In-class exercise



computing fibonacci numbers



efficient computation of fibonacci numbers



recursive data structures



problem solving with recursion



Solution to the Towers of Hanoi



Finding a path through a maze



Backtracking



garbage collection