Filters
Question type

Study Flashcards

A base case is not necessary for all recursive algorithms.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

There must be only one function involved in any recursive solution.

Correct Answer

verifed

verified

Which would be the base case in a recursive solution to the problem of finding the factorial of a number. Recall that the factorial of a non-negative whole number is defined as n! where: If n = 0,then n! = 1 If n > 0,then n! = 1 x 2 x 3 x ... X n


A) n = 0
B) n = 1
C) n > 0
D) The factorial of a number cannot be solved with recursion.

Correct Answer

verifed

verified

In many cases it is easier to see how to solve a problem with recursion than with a loop.

Correct Answer

verifed

verified

Recursion is


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

Correct Answer

verifed

verified

What defines the depth of recursion?


A) the length of the algorithm
B) the number of function calls
C) the number of times the function calls itself
D) the number of times the function goes to the base case

Correct Answer

verifed

verified

Recursion is sometimes required to solve certain types of problems.

Correct Answer

verifed

verified

Usually a problem solved by recursion is reduced by making the value of one or more parameters __________ with each recursive call.

Correct Answer

verifed

verified

Recursive function calls are __________ efficient than loops.

Correct Answer

verifed

verified

When,in a recursive solution,function A calls function B which,in turn,calls function A,this is known as indirect recursion.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

What is the first step to take in order to apply a recursive approach?


A) Identify at least one case in which the problem can be solved without recursion.
B) Determine a way to solve the problem in all circumstances using recursion.
C) Identify a way to stop the recursion.
D) Determine a way to return to the main function.

Correct Answer

verifed

verified

The base case is the case in which the problem can be solved without


A) loops
B) decisions
C) objects
D) recursion

Correct Answer

verifed

verified

Which of the following describes the base case in a recursive solution?


A) a case in which the problem can be solved without recursion
B) the case in which the problem is solved through recursion
C) the way to stop the recursion
D) the way to return to the main function

Correct Answer

verifed

verified

Showing 21 - 35 of 35

Related Exams

Show Answer