Filters
Question type

Study Flashcards

A function is called from the main function and then it calls itself five times. The depth of recursion is _______________.

Correct Answer

verifed

verified

A function is called from the main function for the first time. It then calls itself seven times. What is the depth of recursion?


A) Eight
B) Two
C) One
D) Seven

Correct Answer

verifed

verified

Recursion is _____.


A) never required to solve a problem
B) required to solve mathematical problems
C) never required to solve string problems
D) required to solve some problems

Correct Answer

verifed

verified

In many cases a solution using recursion is more evident than a solution using a loop.

Correct Answer

verifed

verified

If the problem cannot be solved now, then a recursive function reduces it to a smaller but similar problem and _____.


A) exits
B) returns to the main function
C) returns to the calling function
D) calls itself to solve the smaller problem

Correct Answer

verifed

verified

What is referred to as the recursive case?


A) At least one case in which the problem can be solved without recursion
B) A way to solve the problem in all other circumstances using recursion
C) The way to stop the recursion
D) The way to return to the main function

Correct Answer

verifed

verified

The majority of repetitive programming tasks are best done with _______________.

Correct Answer

verifed

verified

What is referred to as the base case?


A) At least one case in which the problem can be solved without recursion
B) The circumstances to solve the problem using recursion
C) The way to stop the recursion
D) The way to return to the main function

Correct Answer

verifed

verified

If the problem can be solved immediately without recursion, then the recursive function _____.


A) solves it and returns
B) Exits
C) returns the result
D) generates a run-time error

Correct Answer

verifed

verified

What defines the depth of recursion?


A) The length of the algorithm
B) The numbers of function calls
C) The number of times the function calls itself
D) The number of times it goes back to the main function

Correct Answer

verifed

verified

All the cases of the recursive solution other than the base case are called the _______________ case.

Correct Answer

verifed

verified

When function A calls function B, which in turn calls function A, it is known as indirect recursion.

Correct Answer

verifed

verified

The base case does not require _______________, so it stops the chain of recursive calls.

Correct Answer

verifed

verified

Function A calls function B, which calls function C, which calls function A. This is called _____ recursion.


A) continuous
B) direct
C) three function call
D) indirect

Correct Answer

verifed

verified

A recursion in which a function directly calls itself is known as _______________ recursion.

Correct Answer

verifed

verified

Showing 21 - 35 of 35

Related Exams

Show Answer