Filters
Question type

Study Flashcards

If a problem can be solved immediately without recursion,then the recursive function


A) solves it and returns
B) exits
C) returns a default value
D) generates a run-time error

Correct Answer

verifed

verified

A problem can be solved with recursion if it can be broken down into __________ problems.


A) smaller
B) one-line
C) manageable
D) modular

Correct Answer

verifed

verified

If,in a recursive solution,function A calls function B which calls function C,this is called __________ recursion.


A) continuous
B) direct
C) three function call
D) indirect

Correct Answer

verifed

verified

All the cases of a recursive solution other than the base case are called the __________ case.

Correct Answer

verifed

verified

The process of calling a function requires


A) a slow memory access
B) a quick memory access
C) several actions to be performed by the computer
D) one action to be performed by the computer

Correct Answer

verifed

verified

Recursive functions are __________ iterative algorithms.


A) more efficient than
B) less efficient than
C) as efficient as
D) impossible to compare to

Correct Answer

verifed

verified

If a recursive solution is evident for a particular problem,and if the recursive algorithm does not slow system performance by an intolerable amount,then recursion would probably be a good design choice.

Correct Answer

verifed

verified

A function is called from the main function for the first time and then calls itself seven times. What is the depth of recursion?


A) 8
B) 2
C) 1
D) 7

Correct Answer

verifed

verified

Recursive algorithms are always more concise and efficient than iterative algorithms.

Correct Answer

verifed

verified

False

A solution using a(n)__________ is usually more evident than a recursive solution.

Correct Answer

verifed

verified

A recursive function must have some way to control the number of times it repeats.

Correct Answer

verifed

verified

Each time a function is called in a recursive solution,the system incurs overhead that is not incurred with a loop.

Correct Answer

verifed

verified

What is the second step to take in order to apply a recursive approach?


A) Identify at least one case in which the problem can be solved without recursion.
B) Determine a way to use recursion to solve the problem in all circumstances which cannot be solved without recursion.
C) Determine a way to return to the main function.
D) Identify a way to stop the recursion.

Correct Answer

verifed

verified

A function is called from the main function and then it calls itself five times. The depth of recursion is __________.

Correct Answer

verifed

verified

A recursive function includes __________ which are not necessary in a loop structure.


A) function calls
B) conditional clauses
C) overhead actions
D) object instances

Correct Answer

verifed

verified

Each time a function is called,the system incurs __________ that is not necessary with a loop.

Correct Answer

verifed

verified

overhead

In a recursive solution,if the problem cannot be solved now,then a recursive function reduces it to a smaller but similar problem and


A) exits
B) returns to the main function
C) returns to the calling function
D) calls itself to solve the smaller problem

Correct Answer

verifed

verified

A problem can normally be solved with recursion if it can be broken down into smaller problems that are identical in structure to the overall problem.

Correct Answer

verifed

verified

The majority of repetitive programming tasks are best done with ___________.

Correct Answer

verifed

verified

Some problems are more __________ solved with recursion than with a loop.

Correct Answer

verifed

verified

easily

Showing 1 - 20 of 35

Related Exams

Show Answer