If you have the third edition
- Chapter 2: Exercise 4 (page 127 or click here)
- Chapter 3 (Recursion): Exercises 9, 12, 16 (pages 190 - 192)
- Write a recursive method that will compute the sum of the first n integers in an array of at least n integers. Hint: Begin with the nth integer.
- Describe the problem with the following recursive method:
public void printNum (int n)
{
System.out.println(n);
printNum (n - 1);
}
If you have the second edition
If you have the updated edition
- Chapter 1: Exercise 3 (page 42 or click here)
- Chapter 2 (Recursion): Exercises 3, 6, 9, 11, 16 (pages 97 - 100)
Note: exercise 16 is drawing box traces for binary search; let me know if this does not match your edition.
The assignment should be done individually.
[Back to the Assignments Index]