Services
Discover
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Programming From Problem Analysis to Program Design
Exam 13: Recursion
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 41
Multiple Choice
Which of the following statements is NOT true about infinite recursion?
Question 42
True/False
The body of a recursive method contains a statement that causes the same method to execute before completing the current call.
Question 43
Multiple Choice
public static int func1(int m, int n) { If (m == n || n == 1) Return 1; Else Return func1(m - 1, n - 1) + n * func1(m - 1, n) ; }Given the code in the accompanying figure, which of the following method calls would result in the value 1 being returned?
Question 44
Multiple Choice
public static int func1(int m, int n) { If (m == n || n == 1) Return 1; Else Return func1(m - 1, n - 1) + n * func1(m - 1, n) ; }What precondition must exist in order to prevent the code in the accompanying figure from infinite recursion?
Question 45
True/False
Recursive algorithms are implemented using while loops.
Question 46
True/False
Every recursive definition can have zero or more base cases.
Question 47
Multiple Choice
____ is NOT an iterative control structure.
Question 48
True/False
To design a recursive method, you must determine the limiting conditions.
Question 49
Multiple Choice
Consider the following definition of a recursive method.public static int recFunc(int num) { If (num >= 10) Return 10; Else Return num * recFunc(num + 1) ; }What is the output of the following statement?System.out.println(recFunc(10) ) ;