Exam 15: Recursion

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

Which of the following problems can be solved recursively?

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

D

This occurs when method A calls method B, which in turn calls method A.

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

D

The Towers of Hanoi is a mathematical game that is often used in computer science textbooks to illustrate the power of recursion.

Free
(True/False)
4.7/5
(85)
Correct Answer:
Verified

True

A problem can be solved recursively if it can be broken down into successive smaller problems that are identical to the overall problem.

(True/False)
4.8/5
(88)

The actions performed by the JVM that take place with each method call are sometimes referred to as this.

(Multiple Choice)
4.9/5
(92)

Whereas a recursive algorithm might result in faster execution time, the programmer might be able to design an iterative algorithm faster.

(True/False)
4.7/5
(80)

A recursive method can have no more than one base case.

(True/False)
4.9/5
(81)

Like a loop, a recursive method must have which of the following?

(Multiple Choice)
4.7/5
(87)

Any problem that can be solved recursively can also be solved iteratively, with a loop.

(True/False)
4.8/5
(84)

A method is called from the main method for the first time. It then calls itself seven times. What is the depth of recursion? A) 1 B) 7 C) 8 D) 6

(Short Answer)
4.9/5
(76)

The recursive binary search algorithm is a good example of repeatedly breaking a problem down into smaller pieces until it is solved.

(True/False)
5.0/5
(79)

A method that calls itself is a ________ method.

(Multiple Choice)
4.7/5
(70)

Without a base case, a recursive method will call itself only once and stop.

(True/False)
4.8/5
(79)

When recursive methods directly call themselves, it is known as this.

(Multiple Choice)
4.9/5
(65)

In the ________, we must always reduce the problem to a smaller version of the original problem.

(Multiple Choice)
4.9/5
(68)

Recursion can be a powerful tool for solving repetitive problems and is an important topic in upper-level computer science courses.

(True/False)
4.9/5
(82)

The ________ is at least one case in which a problem can be solved without recursion.

(Multiple Choice)
4.9/5
(79)

Recursion is never absolutely required to solve a problem.

(True/False)
5.0/5
(65)

The number of times that a method calls itself is known as

(Multiple Choice)
4.8/5
(73)

The recursive case does not require recursion, so it stops the chain of recursive calls.

(True/False)
4.8/5
(74)
close modal

Filters

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