Exam 19: Recursion

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

A ________ function is one that calls itself

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

C

The programmer must ensure that a recursive function does not become:

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

C

How many times will the following function call itself, if the value 5 is passed as the argument? How many times will the following function call itself, if the value 5 is passed as the argument?

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

D

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

(True/False)
4.7/5
(83)

The ________ algorithm uses recursion to efficiently sort a list.

(Multiple Choice)
4.9/5
(78)

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

(Multiple Choice)
4.7/5
(76)

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

Like a loop, a recursive function must have some method to control the number of times it repeats.

(True/False)
5.0/5
(75)

The QuickSort algorithm was developed in 1960 by ________.

(Multiple Choice)
4.8/5
(89)

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

If a recursive function does not contain a base case, it ________.

(Multiple Choice)
4.9/5
(70)

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

(Multiple Choice)
5.0/5
(84)

A recursive function cannot call another function.

(True/False)
4.7/5
(87)

Recursive algorithms are less efficient than iterative algorithms.

(True/False)
4.8/5
(59)

Recursion can be used to:

(Multiple Choice)
4.9/5
(81)

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

(Multiple Choice)
4.9/5
(67)

The QuickSort algorithm is used to sort ________.

(Multiple Choice)
4.9/5
(77)

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

(True/False)
4.9/5
(67)

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

(Multiple Choice)
4.9/5
(71)

The QuickSort algorithm works on the basis of

(Multiple Choice)
4.7/5
(82)
Showing 1 - 20 of 22
close modal

Filters

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