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
(33)

  -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.9/5
(43)

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
(37)

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
(39)

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.7/5
(35)

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

(Short Answer)
4.9/5
(38)

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

(True/False)
4.8/5
(33)

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

(Multiple Choice)
4.8/5
(38)

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
(34)

  -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
(42)

  -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
(34)

A function is called ____ if it calls itself.

(Multiple Choice)
4.8/5
(44)

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

(True/False)
4.8/5
(40)

Infinite recursions execute forever on a computer.

(True/False)
4.9/5
(33)

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

(Multiple Choice)
4.8/5
(33)

  -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.8/5
(31)

  -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.8/5
(31)

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

(Multiple Choice)
4.7/5
(43)

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

(Short Answer)
4.9/5
(41)

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

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

Filters

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