Exam 14: Recursion

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

The base case of a recursive function

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

E

The ________ algorithm uses recursion to sort an array.

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

B

The quicksort algorithm works on the basis of

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

B

Suppose that a recursive function with integer parameter n has a base case of 0, and for each non-base case, the function makes a recursive call with argument n+1. If the function is initially called with an actual argument of n = 3, the function call will

(Multiple Choice)
4.9/5
(38)

A recursive function should be designed to stop making recursive calls when it reaches its

(Multiple Choice)
5.0/5
(34)

A ________ function is one that calls itself.

(Multiple Choice)
4.8/5
(33)

The programmer must ensure that a recursive function does not become

(Multiple Choice)
4.8/5
(35)

Recursion can be used to

(Multiple Choice)
4.8/5
(37)

The function int fact(int k) { Return k*fact(k-1); If (k==0) return 1; }

(Multiple Choice)
4.8/5
(42)

The QuickSort algorithm was developed in 1960 by

(Multiple Choice)
4.8/5
(32)

When a function A calls a function B, which in turn calls A, we have

(Multiple Choice)
4.7/5
(32)

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

(Multiple Choice)
5.0/5
(25)

Any algorithm that can be coded with recursion can also be coded using a loop.

(True/False)
4.7/5
(31)

The speed and amount of memory available to modern computers diminishes the performance impact of the overhead of recursion so much that for many applications, this overhead is not noticeable.

(True/False)
4.9/5
(33)

Indirect recursion means that a function calls itself several times.

(True/False)
4.9/5
(24)

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

(True/False)
5.0/5
(40)

A recursive function cannot call a function other than itself.

(True/False)
4.8/5
(32)

Recursive algorithms tend to be less efficient than iterative algorithms.

(True/False)
4.8/5
(34)

A recursive function that does not correctly handle its base case may

(Multiple Choice)
4.8/5
(23)

The quicksort algorithm can be used to

(Multiple Choice)
4.9/5
(29)
close modal

Filters

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