CS 221 Lab--Recursion
Fall 2006

Lecture Schedule                    TA (Sam Gardner) page

Lab 9: Recursion

  1. Finish and demo the lab that is due today.
  2. Because we have not yet had a chance to talk about recursion in lecture, this morning in lab you should read in your text about how a recursive binary search works.
  3. Implement a binary search from the code in your book, and test it.


Recursive Problem:  Finding the largest item in an array
Suppose you have an array of integers, and you want to find the largest one using recursion (yes, I know you can do it easily using iteration, but I want you to learn how to design and implement a recursive solution!)

The problem

Part 1: The Design

Part 2: The Implementation