Exam 13: Recursion

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

The idea of __________ is to reduce the size of a problem at each step so that we eventually arrive at a very small, easy-to-solve problem.

(Multiple Choice)
4.8/5
(41)

What would be a good first base case if you were determining whether a String is a palindrome?

(Multiple Choice)
4.8/5
(32)

With a tail recursive method, the ___________ stays the same.

(Multiple Choice)
5.0/5
(39)

Why is recursion often slower than iteration?

(Multiple Choice)
4.7/5
(38)

Recursion allows us to do which of the following?

(Multiple Choice)
4.7/5
(40)

The efficiency of the method at execution time is called the:

(Multiple Choice)
5.0/5
(35)

Which code would you use to trace recursive calls, where the desired expression goes inside the parentheses?

(Multiple Choice)
4.9/5
(38)

Identify the two things you must define in order to construct a recursive solution to a problem.

(Essay)
5.0/5
(41)

Evaluate why a recursion method is useful for calculating the greatest common divisor.

(Essay)
4.7/5
(40)

A recursive function is implemented using decision constructs, while an iterative function is implemented with looping constructs.

(True/False)
4.8/5
(28)

Each execution of the recursive method must wait to return its value until its recursive call to the method returns a value.

(True/False)
4.8/5
(41)

Usually, not coding the base case will result in a runtime exception caused by the infinite number of recursive calls.

(True/False)
4.9/5
(38)

In solving the Towers of Hanoi problem, when the if statement identifies the base case, it allows the program to keep moving disks until there are no more disks to move.

(True/False)
4.8/5
(37)

A factorial method is complete when it generates:

(Multiple Choice)
4.7/5
(32)

List three features that make using an iteration preferable to a recursion in printing "Happy Birthday" 10 times.

(Essay)
4.8/5
(40)

When the recursive calls all the way to the base case and the return value stays the same throughout the process, the method is called:

(Multiple Choice)
4.8/5
(34)

In the body of a recursive method, there is a call to the:

(Multiple Choice)
4.8/5
(41)

It is possible that a method does nothing in the base case.

(True/False)
4.9/5
(32)

Which of the following are reasons to choose recursion over iteration?

(Multiple Choice)
4.9/5
(33)

If there are two recursive terms on the right side of the formula, there will be one base case.

(True/False)
4.8/5
(46)
Showing 21 - 40 of 59
close modal

Filters

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