Question: 0 1 . A method that calls itself is called a a . base method b . iterative method c . recursive method d .
A method that calls itself is called a
a base method
b iterative method
c recursive method
d dynamic method
MC Answer:
The condition when a recursive method does not satisfy a base case it is called
a finite recursion
b infinite recursion
c iterative recursion
d baseless recursion
MC Answer:
When too many recursive calls are made creating more activation records than the allocated program memory can handle, what kind of error occurs?
a activation record overflow
b recursive overflow
c infinite recursion
d stack overflow
MC Answer:
What happens when a recursive method does not reach the base case?
a the program crashes
b a stack overflow occurs
c both a & b
d none of the above
MC Answer:
Recursion can be used to solve problems like
a processing linked chains
b processing arrays
c sorting
d all of the above
MC Answer:
Recursive methods
a are useful when each recursive all is a solution to a smaller, identical problem
b do not use an ifstatement
c are not useful in programming
d all of the above
MC Answer:
Recursive methods need an
a for or while loop
b trace
c base case
d all of the above
MC Answer:
What questions should you keep in mind when debugging a recursive method?
a Is there at least one recursive call?
b Did you consider all possible cases?
c Does the method contain a statement to test an input value and leads to different cases?
d All of the above.
MC Answer:
What questions should you keep in mind when debugging a recursive method?
a Does each base case produce a result that is correct for that case?
b Are there enough base cases?
c Is at least one of the cases a base case that has no recursive call?
d All of the above.
MC Answer:
What questions should you keep in mind when debugging a recursive method?
a Should a forloop be included in the method?
b If the method returns a value, does each of the cases return a value?
c Are the activation records correct?
d All of the above.
MC Answer:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
