Quiz 8

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What phrase describes the action of the method calls after the base case has been reached in the recursion process?

"the solution of the base case is passed up the line"

Select all rules which govern how discs must be moved in the Towers of Hanoi puzzle.

A larger disk may never be placed on top of a smaller disk. Only one disk may be moved at a time.

An If statement is absolutely necessary in any method which implements repetition through recursion.

False

It is illegal to program a recursive function.

False

Recursion is a program statement with a special word that identifies it as part of the Alice programming language.

False

Recursion should not be used to handle situations where the programmer does not know how many times a loop should be repeated.

False

The base case in a recursive call is a signal that only one more recursive step is remaining.

False

When writing methods where repetition is implemented through recursion, what control structure would most likely be used?

If

If recursion is used to break a problem down into smaller and smaller sub-problems, the solutions to the smaller sub-problems are used to cooperatively solve the larger problem.

True

Moving forward a negative distance is the same as moving backward a positive distance.

True

Recursion enables a method to be repeatedly called.

True

Recursion is a form of repetition.

True

Recursion occurs when a method calls itself.

True

The Loop and While control structures are generally not used with recursion.

True

What repetition structures below are most commonly used when the number of times a block of code should be repeated is unknown.

While REcursion

Any method which implements repetition through recursion is most concerned with ____________.

a tested condition which signals the recursion to end

What is recursion?

a well-known programming technique where a method calls itself

What is the smallest problem solved by recursion most commonly known as?

base case

How can repetition be implemented with recursion?

by calling, from within itself, the method containing an instruction wished to be repeated

The collective goal of recursion typically is to ___________.

solve an entire problem


Set pelajaran terkait

Chapter 1: Intro to Financial Planning

View Set

Professional Responsibility Multiple Choice

View Set

A&P II - Unit 5: Reproductive System

View Set

Module 5 HESI Management of Care

View Set

Chapter 13: Reading Tasks/ Homework

View Set