Chapter 13

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which of the following can be solved with recursion?

All of the above

The choice between using recursion or a loop is primarily a ________ decision.

Design

True/False: In a recursive algorithm, the computer completes the base case first and then works on the recursive cases.

False

When module A is calling module B and module B calls module A, it is called ________ recursion.

Indirect

If a recursive module has no code to stop it from repeating then it is like a ________ loop.

Infinite

True/False: Comparing the recursive algorithm of a binary search with its counterpart, without recursion, it is much more elegant and easier to understand.

True

True/False: It is possible for a module to call itself.

True

True/False: The Fibonacci Series is a well-known mathematical problem that is solved recursively.

True

True/False: There can be several modules involved in a recursive algorithm.

True

When the recursive module makes the last call to itself, the If-Then statements condition expression is ________.

false

The total number of times a module calls itself recursively is known as the ________ of recursion.

Depth

True/False: It is not necessary to have a conditional expression to terminate the recursive calls.

False

True/False: One of the advantages of a recursive algorithm is that it does not matter how many recursive calls are made to a module; only one instance of the parameters are needed.

False

True/False: Recursive algorithms are more efficient that iterative algorithms.

False

True/False: The depth of recursion refers to the length and complexity of the recursive algorithm.

False

True/False: The term "callback potential" refers to number of times a module calls itself.

False

True/False: When creating a recursive algorithm it is optional to identify the base case and the recursive case of the algorithm.

False

The first step in setting up a recursive module is to ________.

Identify at least one case in which the problem can be solved without recursion

Each time a recursive module calls itself, it creates a new ________ of the parameters of the modules.

Instance

In the following example, how many times does the module calls itself? Module main ( ) Call Welcome (5) End Module Module Welcome (Integer number) If number > 0 Then Display "Welcome to our store." Call Welcome (number - 1) End If End Module

6

A recursive module is similar to a(n) ________ in that it must have some way to control the number of times it repeats.

Loop structure

The majority of repetitive programming tasks are best done with which of the following?

Loops

The process of calling a module requires several actions to be performed by the computer and is referred to as ________.

Overhead

A ________ module is a type of module that calls itself.

Recursive

In the ________ case the problem is reduced to a smaller version of the original problem.

Recursive

Recursion can be a powerful tool for solving ________ problems.

Repetitive

A problem can be solved with recursion if it can be broken down into ________ that are identical to the overall problem.

Successive smaller problems

Which of the following is a mathematical game that is often used in computer science textbooks to demonstrate the power of recursion?

The Towers of Hanoi

True/False: A recursive algorithm is never required to solve a problem.

True

If a recursive module calls itself ten times, after the tenth call it returns to the ________.

ninth call


Conjuntos de estudio relacionados

MANA 3335 (9-13) Learn it & Assignment Questions

View Set

Pearson - Cholecystitis (inflammation)

View Set

Ch. 58 Care of Pts with Liver Problems

View Set

MACRO Chpt 20: International Finance

View Set

World Civ II Unit 2 Study Guide: Ming-Qing China and the Indian Mughal Dynasty

View Set

Ch 7 Standard Costing and Variance Analysis MCQ's

View Set