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

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

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

Infinite recursions execute forever on a computer.

(True/False)
4.8/5
(37)

  -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)
4.9/5
(30)

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

(Multiple Choice)
4.8/5
(36)

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

(True/False)
4.8/5
(34)

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

A function is called ____ if it calls itself.

(Multiple Choice)
4.8/5
(33)

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

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

(True/False)
4.9/5
(42)

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)
4.9/5
(36)

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

(True/False)
4.8/5
(35)

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

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

  -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)
4.9/5
(44)

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

(Multiple Choice)
4.9/5
(51)

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

(Short Answer)
4.8/5
(34)

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

(Multiple Choice)
4.7/5
(38)

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

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

Filters

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