Exam 19: Recursion

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

The recursive factorial function calculates the factorial of its parameter. Its base case is when the parameter is _______.

Free
(Multiple Choice)
4.8/5
(89)
Correct Answer:
Verified

D

How many times will the following function call itself, if 5 is passed as the argument? void showMessage(int n) { If (n > 0) { Cout << "Good day!" << endl; ShowMessage(n - 1); } }

Free
(Multiple Choice)
4.9/5
(86)
Correct Answer:
Verified

C

The QuickSort algorithm is used to sort _____________.

Free
(Multiple Choice)
4.7/5
(91)
Correct Answer:
Verified

A

The __________ algorithm uses recursion to efficiently sort a list.

(Multiple Choice)
4.8/5
(77)

Recursive algorithms are less efficient than iterative algorithms.

(True/False)
4.9/5
(68)

A recursive function that does not have a termination will eventually

(Multiple Choice)
5.0/5
(81)

A __________ function is one that calls itself

(Multiple Choice)
4.8/5
(96)

When function A calls function B, which in turn calls function A, this is known as:

(Multiple Choice)
4.8/5
(69)

The QuickSort algorithm was developed in 1960 by _________.

(Multiple Choice)
4.8/5
(77)

A recursive function cannot call another function.

(True/False)
4.7/5
(97)

How many times will the following function call itself, if 5 is passed as the argument? void showMessage(int n) { If (n > 0) { Cout << "Good day!" << endl; ShowMessage(n + 1); } }

(Multiple Choice)
4.9/5
(80)

The QuickSort algorithm works on the basis of

(Multiple Choice)
4.9/5
(79)

The __________ of recursion is the number of times a recursive function calls itself.

(Multiple Choice)
4.7/5
(82)

The speed and amount of memory available to modern computers diminishes the performance impact of recursion so much that inefficiency is no longer a strong argument against it.

(True/False)
4.8/5
(83)

When a recursive function directly calls itself, this is known as direct recursion.

(True/False)
4.8/5
(71)

A recursive function is designed to terminate when it reaches its ________.

(Multiple Choice)
4.9/5
(77)

Recursion can be used to:

(Multiple Choice)
4.9/5
(82)

Any algorithm that can be coded with recursion can also be coded with an iterative structure.

(True/False)
4.8/5
(86)

Indirect recursion means that a function calls itself n number of times, then processing of the function starts from the first call.

(True/False)
4.8/5
(85)

When recursion is used on a linked list, it will always display the contents of the list in reverse order.

(True/False)
4.9/5
(73)
Showing 1 - 20 of 21
close modal

Filters

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