Exam 13: Recursion
Exam 1: Introduction to Programming and the Java Language47 Questions
Exam 2: Programming Building Blocks- Java Basics57 Questions
Exam 3: Object-Oriented Programming, Part 1: Using Classes62 Questions
Exam 4: Introduction to Graphical Applications57 Questions
Exam 5: Flow of Control, Part 1: Selection68 Questions
Exam 6: Flow of Control, Part 2: Looping67 Questions
Exam 7: Object-Oriented Programming, Part 2: User-Defined Classes78 Questions
Exam 8: Single-Dimensional Arrays63 Questions
Exam 9: Multidimensional Arrays and the Arraylist Class62 Questions
Exam 10: Object-Oriented Programming, Part 3: Inheritance, Polymorphism, and Interfaces61 Questions
Exam 11: Exceptions, and Input Output Operations77 Questions
Exam 12: Graphical User Interfaces Using Java FX89 Questions
Exam 13: Recursion59 Questions
Exam 14: An Introduction to Data Structures69 Questions
Exam 15: Running Time Analysis56 Questions
Exam 16: RGB Colors, Decimal Conversion, Java Naming, and Random Number Generation110 Questions
Select questions type
If your method implementation does not animate or animates incorrectly, which of the following should you do?
Free
(Multiple Choice)
4.9/5
(40)
Correct Answer:
A
Using the gcd method, Aidan coded a program to find the common divisor for 43,822 and 52,003. Instead, he got a StackOverflowError. Infer what happened.
Free
(Essay)
4.9/5
(31)
Correct Answer:
The base case wasn't identified.
When a method is called, the JVM stores the method's arguments and the caller's return address on a(n):
Free
(Multiple Choice)
4.9/5
(32)
Correct Answer:
D
Why might you want to use a recursive method instead of a loop?
(Multiple Choice)
4.8/5
(38)
A base case must have the words "base case" in order to be coded correctly.
(True/False)
4.7/5
(43)
You are considering running a program similar to the Tower of Hanoi. Which of the following is true?
(Multiple Choice)
4.7/5
(36)
An iterative function is implemented with looping constructs (e.g., while or for statements) and repeatedly executes the loop.
(True/False)
4.9/5
(35)
In the body of a recursive method, there is a call to the method itself.
(True/False)
4.8/5
(36)
A binary search is more easily coded using iteration rather than recursion.
(True/False)
4.8/5
(37)
In a value-returning method, the return statement can include a call to another value-returning method.
(True/False)
4.7/5
(32)
Using recursion, the size of a problem is always reduced by 1 (i.e., from n to n − 1).
(True/False)
4.9/5
(40)
Write a recursive formula in which the following conditions apply:
In the first term, both method parameters, n and p, have each been decreased by 1.
In the second term, n is unchanged, while p is decreased by 1.
(Essay)
4.8/5
(33)
When searching for a value in an array, what are the possible outcomes?
(Multiple Choice)
4.9/5
(42)
Lynn is having a dinner party for six people. She wrote a factorial program to find out how many possible seating arrangements she has available, but she was stunned when the result was 720. That is too many options. How could she improve her program so that she can find a number of possibilities that she could work with? If she finds that number, how could she incorporate it in her seating decisions?
(Essay)
4.8/5
(31)
Showing 1 - 20 of 59
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)