Exam 12: Recursion

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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

(Multiple Choice)
4.8/5
(88)

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

(Multiple Choice)
4.8/5
(80)

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

(True/False)
4.9/5
(79)

Recursion is

(Multiple Choice)
4.9/5
(75)

Recursive function calls are __________ efficient than loops.

(Short Answer)
4.9/5
(86)

What defines the depth of recursion?

(Multiple Choice)
4.9/5
(86)

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

(Short Answer)
4.9/5
(83)

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

(Multiple Choice)
5.0/5
(90)

A base case is not necessary for all recursive algorithms.

(True/False)
4.7/5
(75)

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

(Multiple Choice)
4.8/5
(78)

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

(True/False)
4.9/5
(79)

Recursion is sometimes required to solve certain types of problems.

(True/False)
4.8/5
(73)

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

(Short Answer)
5.0/5
(80)

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

(True/False)
5.0/5
(89)

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

(Short Answer)
4.9/5
(73)
Showing 21 - 35 of 35
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)