Ask a new question
Sign up
Login
Home
Discover Topics
Referral Program
Loans
Flashcards
Upload
Contact us
Topics
Topic
Computing
Study-set
Java Programming
Prev
Quiz
Next
Quiz
Java Programming
Computing
Quiz 13 :
Recursion
Study Flashcards
Looking for
Programming Homework Help?
Unlock Package
Study Flashcards
Unlock Package
Quiz 13 :
Recursion
Prev
Quiz
Next
Quiz
Question Type
All
The process of solving a problem by reducing it to smaller versions of itself is called recursion.
Free
True False
Q01
Answer:
Answer:
True
Tags
Add
Choose question tag
Discard
Apply
A recursive method in which the first statement executed is a recursive call is called a tail recursive method.
Free
True False
Q02
Answer:
Answer:
False
Tags
Add
Choose question tag
Discard
Apply
A program will terminate after completing any particular recursive call.
Free
True False
Q03
Answer:
Answer:
False
Tags
Add
Choose question tag
Discard
Apply
The base case starts the recursion.
True False
Q04
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
The recursive implementation of the factorial method is an example of a tail recursive method.
True False
Q05
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
In reality, if you execute an infinite recursive method on a computer, it will execute forever.
True False
Q06
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
You can think of a recursive method as having unlimited copies of itself.
True False
Q07
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
The body of a recursive method contains a statement that causes the same method to execute before completing the current call.
True False
Q08
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
A method that calls another method and eventually results in the original method call is called indirectly recursive.
True False
Q09
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
To design a recursive method, you must determine the limiting conditions.
True False
Q10
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
In the base case of a recursive solution, the solution is obtained through a call to a smaller version of the original method.
True False
Q11
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
The following is an example of a recursive method. public static int recFunc(int x) {return (nextNum(nextNum(x)));} where nextNum is method such that nextNum(x) = x + 1.
True False
Q12
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
If every recursive call results in another recursive call, then the recursive method (algorithm) is said to have infinite recursion.
True False
Q13
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
Every recursive call has its own code.
True False
Q14
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
A method that calls itself is an iterative method.
True False
Q15
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
Every recursive definition can have zero or more base cases.
True False
Q16
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
The general case of a recursive solution is the case for which the solution is obtained directly.
True False
Q17
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
A method is called directly recursive if it calls another recursive method.
True False
Q18
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
A general case to a recursive algorithm must eventually reduce to a base case.
True False
Q19
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
The following is a valid recursive definition to determine the factorial of a non-negative integer. 0! = 1 1! = 1 n! = n * (n - 1)! if n > 0
True False
Q20
Answer:
Unlock to view answer
Tags
Add
Choose question tag
Discard
Apply
Showing 1 - 20 of 50
Prev
1
...
2
...
3
...
Next