Exam 15: Recursion

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

If every recursive call results in another recursive call, then the recursive function (algorithm) is said to have ____ recursion.

(Multiple Choice)
4.9/5
(81)

  -Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << recFunc(10) << endl; -Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << recFunc(10) << endl;

(Multiple Choice)
4.8/5
(93)

The recursive algorithm must have one or more base cases, and the general solution must eventually be reduced to a(n) ____________________.

(Short Answer)
4.8/5
(85)

Consider the following recursive definition, where n is a positive integer. The value of F(3) is ____________________. Consider the following recursive definition, where n is a positive integer. The value of F(3) is ____________________.

(Short Answer)
5.0/5
(84)

Consider the following definition of the recursive function print. What is the output of the following statement? Print(4); Consider the following definition of the recursive function print. What is the output of the following statement? Print(4);

(Multiple Choice)
4.8/5
(65)

If you execute an infinite recursive function on a computer, the function executes until the system runs out of ____________________.

(Short Answer)
4.9/5
(83)

In a recursive function, the base case stops the recursion.

(True/False)
4.8/5
(79)

Tracing through ____ recursion is more tedious than tracing other recursive forms.

(Multiple Choice)
4.8/5
(82)

In the Tower of Hanoi problem, if needle 1 contains three disks, then the number of moves required to move all three disks from needle 1 to needle 3 is ____________________.

(Short Answer)
4.8/5
(77)

  -Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << puzzle(5, 10) << endl; -Consider the accompanying definition of a recursive function. What is the output of the following statement? cout << puzzle(5, 10) << endl;

(Multiple Choice)
4.9/5
(94)

  -Consider the accompanying definition of a recursive function. Which of the statements represents the base case? -Consider the accompanying definition of a recursive function. Which of the statements represents the base case?

(Multiple Choice)
4.9/5
(72)

A function is called ____ if it calls itself.

(Multiple Choice)
4.9/5
(99)

With recursion, the base case must eventually be reduced to a general case.

(True/False)
4.8/5
(84)

Infinite recursions execute forever on a computer.

(True/False)
4.9/5
(76)

Which of the following solutions is easier to construct for the Tower of Hanoi problem?

(Multiple Choice)
4.8/5
(75)

  -Consider the accompanying definition of a recursive function. Which of the statements represent the general case? -Consider the accompanying definition of a recursive function. Which of the statements represent the general case?

(Multiple Choice)
4.9/5
(75)

  -Consider the accompanying definition of a recursive function. Which of the statements represent the general case? -Consider the accompanying definition of a recursive function. Which of the statements represent the general case?

(Multiple Choice)
4.9/5
(71)

A recursive function in which the last statement executed is the recursive call is called a(n) ____ recursive function.

(Multiple Choice)
4.8/5
(90)

If a function A calls a function B and function B calls function A, then function A is ____________________ recursive.

(Short Answer)
4.9/5
(85)

Which of the following rules should you follow to solve the Tower of Hanoi problem?

(Multiple Choice)
4.8/5
(95)
Showing 21 - 40 of 41
close modal

Filters

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