Exam 7: Iterators

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Recursion is a programming technique in which a method calls itself.

Free
(True/False)
4.9/5
(41)
Correct Answer:
Verified

True

Mathematical problems and formulas are never expressed recursively.

Free
(True/False)
4.8/5
(22)
Correct Answer:
Verified

False

When should recursion be avoided?

Free
(Essay)
4.9/5
(38)
Correct Answer:
Verified

Avoid recursion when the iterative solution is simpler and more easily understood and programmed. Recursion has the overhead of multiple method calls and is not always intuitive.

What is infinite recursion?

(Essay)
4.8/5
(49)

Recursion is a programming technique in which a ________ calls itself.

(Multiple Choice)
4.9/5
(41)

Any recursive definition must have a non-recursive part, called the ___________, which permits the recursion to eventually end.

(Multiple Choice)
4.8/5
(35)

Recursion is the most elegant and appropriate way to solve ________ problems, but for others it is less intuitive than an iterative solution.

(Multiple Choice)
4.8/5
(29)

What is the output of the following program?

(Essay)
4.7/5
(41)

If a problem can be solved with iteration, it cannot be solved with recursion

(True/False)
4.8/5
(39)

Recursion is the most elegant and appropriate way to solve some problems, but for others it is less intuitive than an iterative solution.

(True/False)
4.9/5
(35)

Each recursive call to a method creates ______ local variables and parameters.

(Short Answer)
4.8/5
(41)

If method m1 invokes m2 which invokes m3 which invokes m1 again, then this is an example of ______

(Short Answer)
4.8/5
(44)

The Towers of Hanoi solution has exponential complexity, which is very inefficient. Yet the implementation of the solution is incredibly short and ______.

(Short Answer)
4.7/5
(34)

A careful _______ of recursive processing can provide insight into the way it is used to solve a problem.

(Multiple Choice)
4.8/5
(33)

Each recursive call to a method creates new __________ and __________.

(Multiple Choice)
4.9/5
(39)

The order of a recursive algorithm can be determined using techniques similar to analyzing iterative processing.

(True/False)
4.8/5
(33)

Mathematical problems and formulas are often expressed ______.

(Short Answer)
4.9/5
(46)

A recursive definition without a base-case will lead to ______.

(Short Answer)
4.9/5
(48)

Any recursive definition must have a nonrecursive part, called the base case, which permits the recursion to eventually end.

(True/False)
4.8/5
(30)

A careful trace of recursive processing can provide insight into the way it is used to solve a problem.

(True/False)
4.7/5
(41)
Showing 1 - 20 of 32
close modal

Filters

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