Exam 3: Recursion: the Mirrors
Exam 1: Review of Java Fundamentals60 Questions
Exam 2: Principles of Programming and Software Engineering60 Questions
Exam 3: Recursion: the Mirrors60 Questions
Exam 4: Data Abstraction: The Walls60 Questions
Exam 5: Linked Lists60 Questions
Exam 6: Problem Solving With Abstract Data Types60 Questions
Exam 7: Stacks60 Questions
Exam 8: Queues60 Questions
Exam 9: Advanced Java Topics60 Questions
Exam 10: Algorithm Efficiency and Sorting60 Questions
Exam 11: Trees60 Questions
Exam 12: Tables and Priority Queues60 Questions
Exam 13: Advanced Implementations of Tables60 Questions
Exam 14: Graphs60 Questions
Exam 15: External Methods30 Questions
Select questions type
Suppose sa is a sorted array of integer values,and we wish to search for a number target in this array.If sa contains n elements,and we use the binary search strategy,what is the approximate maximum number of comparisons necessary to determine that the value target is or is not in the array? How would your answer change if the array were not sorted?
(Essay)
4.8/5
(35)
Which of the following is NOT a precondition for an array that is to be sorted by a recursive binary search algorithm? (first is the index of the first item in the array,last is the index of the last item in the array,and SIZE is the maximum size of the array)
(Multiple Choice)
4.8/5
(42)
When constructing a recursive solution,you should assume that a recursive call's postcondition is true if its precondition is true.
(True/False)
4.9/5
(37)
In the box trace,each box roughly corresponds to a(n)______.
(Multiple Choice)
4.7/5
(34)
In the box trace,each box contains all of the following EXCEPT ______.
(Multiple Choice)
4.7/5
(44)
What are the four questions that must be considered when constructing a recursive solution?
(Essay)
4.8/5
(29)
The base case for a recursive definition of the factorial of n is ______.
(Multiple Choice)
4.9/5
(33)
Why do some compilers automatically replace tail recursion with iteration?
(Essay)
4.9/5
(30)
When you solve a problem by solving two or more smaller problems,each of the smaller problems must be ______ the base case than the original problem.
(Multiple Choice)
4.8/5
(37)
The base case for a recursive solution to the kth smallest item problem cannot be predicted in advance.
(True/False)
4.8/5
(35)
The binary search algorithm can be applied to an unsorted array.
(True/False)
4.8/5
(40)
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?
(Essay)
4.9/5
(41)
Write a recursive method that takes a String parameter and prints out the characters of the string in reverse order.
(Essay)
4.8/5
(39)
How many bases cases will be required in a recursive solution that solves a problem by solving two smaller problems of the same type?
(Multiple Choice)
5.0/5
(37)
If the value being searched for by a recursive binary search algorithm is in the array,which of the following is true?
(Multiple Choice)
4.9/5
(43)
Showing 41 - 60 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)