
For tracing purposes, add a statement as you enter the method to out-
put that the method is called; include the starting and ending indexes
delimiting the sub-array on which the method is called. Also, add a
counter to track how many times the method is called as the recursive
calls unfold. In your client program, use arrays with 4, 8, 16, 32, and
64 elements. How many recursive calls are made in each case? More
generally, if the array contains 2
n
elements, how many recursive calls
are made?
1000 CHAPTER 13 Recursion
EXERCISES,PROBLEMS, AND PROJECTS
4963X_CH13_Anderson.qxd 10/31/07 5:36 AM Page 1000