Exam 13: Recursion
Exam 1: Introduction76 Questions
Exam 2: Using Objects82 Questions
Exam 3: Implementing Classes108 Questions
Exam 4: Fundamental Data Types124 Questions
Exam 5: Decisions119 Questions
Exam 6: Loops107 Questions
Exam 7: Arrays and Array Lists117 Questions
Exam 8: Designing Classes88 Questions
Exam 9: Inheritance99 Questions
Exam 10: Interfaces100 Questions
Exam 11: Input/Output and Exception Handling108 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion99 Questions
Exam 14: Sorting and Searching100 Questions
Exam 15: The Java Collections Framework102 Questions
Exam 16: Basic Data Structures102 Questions
Exam 17: Tree Structures102 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Stream Processing85 Questions
Exam 20: Graphical User Interfaces75 Questions
Exam 21: Advanced Input/Output90 Questions
Exam 22: Multithreading81 Questions
Exam 23: Internet Networking74 Questions
Exam 24: Relational Databases75 Questions
Exam 25: XML74 Questions
Select questions type
Consider the recursive version of the fib method from the textbook shown below:
How many total recursive calls (not counting the original call) to fib will be made from the original call of fib(6)?

(Multiple Choice)
4.7/5
(44)
Complete the following code snippet, which is intended to be a recursive method that will find the smallest value in an array of double values from index to the end of the array:

(Multiple Choice)
4.9/5
(38)
____ recursion can occur when a recursive algorithm does not contain a special case to handle the simplest computations directly.
(Multiple Choice)
4.9/5
(41)
Given the following class code:
What values will be printed when this code is executed?

(Multiple Choice)
4.9/5
(41)
Consider the following code snippet for recursive addition:
Identify the terminating condition in this recursive method.

(Multiple Choice)
4.7/5
(40)
Which of the following statements about recursion is correct?
(Multiple Choice)
4.8/5
(33)
What is required to make a recursive method successful?
I.special cases that handle the simplest computations directly
II.a recursive call to simplify the computation
III.a mutual recursion
(Multiple Choice)
5.0/5
(35)
Consider the getArea method from the textbook shown below.
Where is/are the terminating condition(s)?

(Multiple Choice)
4.9/5
(30)
Consider the square method shown below that takes a non-negative int argument.Complete the code for the square method so that it correctly calls the squareHelper method to produce the square of n.

(Multiple Choice)
4.7/5
(39)
Consider the following recursive code snippet:
What value is returned from a call to mystery(3,6)?

(Multiple Choice)
5.0/5
(35)
Complete the code for the recursive method shown below, which is intended to compute the sum of the first n positive integers:

(Multiple Choice)
4.9/5
(44)
Consider the code for the recursive method printSum shown in this code snippet, which is intended to return the sum of digits from 1 to n:
Which of the following statements is correct?

(Multiple Choice)
4.8/5
(36)
Consider the following code snippet:
For any given value of n, what is the maximum number of function calls that could occur, including the original call?

(Multiple Choice)
4.9/5
(31)
Why does the best recursive method usually run slightly slower than its iterative counterpart?
(Multiple Choice)
5.0/5
(30)
Consider the getArea method from the textbook shown below.
Where is/are the recursive call(s)?

(Multiple Choice)
4.9/5
(44)
Consider the recursive method myPrint in this code snippet:
What is printed for the call myPrint(821)?

(Multiple Choice)
4.7/5
(37)
Consider the recursive version of the fib method from the textbook shown below:
How many more recursive calls to fib will be made from the original call of fib(7) than from the original call of fib(6) (not counting the original calls)?

(Multiple Choice)
4.8/5
(32)
A palindrome is a word or phrase that reads the same forward or backward.Consider the following code snippet:

(Multiple Choice)
4.9/5
(34)
Consider the helper method reversePrint, which uses recursion to display in reverse the elements in a section of an array limited by the firstIndex and lastIndex arguments.What statement should be used to complete the recursive method?

(Multiple Choice)
4.7/5
(39)
Showing 81 - 99 of 99
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)