Exam 15: Recursion

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

You can use a recursive algorithm to find the largest element in an array.

(True/False)
4.8/5
(86)

Suppose that function A calls function B, function B calls function C, function C calls function D, and function D calls function A.Function A is then ____________________ recursive.

(Short Answer)
4.8/5
(76)

  -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)
5.0/5
(98)

Infinite recursions execute forever on a computer.

(True/False)
4.8/5
(87)

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

(Multiple Choice)
5.0/5
(75)

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

(Multiple Choice)
4.7/5
(80)

The following is an example of a recursive function. The following is an example of a recursive function.

(True/False)
4.9/5
(84)

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

(Multiple Choice)
5.0/5
(96)

A function is called ____ if it calls itself.

(Multiple Choice)
4.8/5
(75)

  -Consider the accompanying definition of the recursive function mystery.Given the declaration:int alpha[5] = {1, 4, 5, 8, 9}; what is the output of the following statement? Cout << mystery(alpha, 0, 4) << endl; -Consider the accompanying definition of the recursive function mystery.Given the declaration:int alpha[5] = {1, 4, 5, 8, 9}; what is the output of the following statement? Cout << mystery(alpha, 0, 4) << endl;

(Multiple Choice)
4.8/5
(83)

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

(True/False)
4.9/5
(86)

Consider the following definition of the recursive function mystery. What is the output of the following statement? Cout << mystery(5) << endl; Consider the following definition of the recursive function mystery. What is the output of the following statement? Cout << mystery(5) << endl;

(Multiple Choice)
5.0/5
(72)

To design a recursive function, you must determine the limiting conditions.

(True/False)
4.8/5
(87)

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

A definition in which something is defined in terms of a smaller version of itself is called a(n) ____ definition.

(Multiple Choice)
4.9/5
(80)

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

(Multiple Choice)
5.0/5
(85)

The ____ case is the case for which the solution to an equation is obtained directly.

(Multiple Choice)
4.9/5
(90)

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

(Short Answer)
4.8/5
(77)

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

(Multiple Choice)
4.7/5
(81)

Which of the following solution methods would be the best choice for a mission control system?

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

Filters

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