CIS210 and 211
[INSERT TITLE HERE] 2
Running head: [INSERT TITLE HERE]
[INSERT TITLE HERE]
Student Name
Allied American University
Author Note
This paper was prepared for [INSERT COURSE NAME], [INSERT COURSE ASSIGNMENT] taught by [INSERT INSTRUCTOR’S NAME].
PART I: Short Response
Directions: Answer each of the following questions. Please ensure that your responses are at least 3 to 5 sentences in length.
1. What items does a sequential search examine when it is successful?
2. What is a base case?
3. What are the four questions that must be considered when constructing a recursive solution?
4. What is a recurrence relation?
5. What is the box trace?
6. What is an activation record?
7. What elements are included in a method’s local environment?
8. What are the two base cases for a recursive binary search algorithm?
9. When is the base case first > last (where first is the index of the first item in the array and last is the index of the last item in the array) reached in a recursive binary search algorithm?
10. When is the base case value == anArray[mid] (where mid is the midpoint of the array) reached in a recursive binary search algorithm?
11. What is a pivot item?
12. What is the base case for the recursive solution to the Towers of Hanoi problem?
13. What are the two factors that contribute to the inefficiency of some recursive solutions?
14. What is a tail-recursive function?
15. Why do some compilers automatically replace tail recursion with iteration?
PART II: Application
Directions: Complete the following exercises found in your textbook.
· Chapter 2, Exercises # 4, 8, 18 (only a, b, and c) on pages 89-92.