Quiz 12, Chapter 12, Python CS 119

Ace your homework & exams now with Quizwiz!

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

True

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. A. True B. False

True

Which of the following describes the base case in a recursive solution? A. the way to return to the main function B. a case in which the problem can be solved without recursion C. the case in which the problem is solved through recursion D. the way to stop the recursion

a case in which the problem can be solved without recursion

A recursive function includes ________ which are not necessary in a loop structure. A. function calls B. overhead actions C. conditional clauses D. object instances

overhead actions

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

recursion

The process of calling a function requires A. one action to be performed by the computer B. a quick memory access C. several actions to be performed by the computer D. a slow memory access

several actions to be performed by the computer

A base case is not necessary for all recursive algorithms. A. True B. False

False

In many cases it is easier to see how to solve a problem with recursion than with a loop. A. True B. False

False

What is the first step to take in order to apply a recursive approach? A. Determine a way to solve the problem in all circumstances using recursion. B. Identify a way to stop the recursion. C. Identify at least one case in which the problem can be solved without recursion. D. Determine a way to return to the main function.

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

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. calls itself to solve the smaller problem D. returns to the calling function

calls itself to solve the smaller problem


Related study sets

Custom: NUR 204 ATI Health Promotion Ch. 16-31

View Set

module 3 comfort fibromyalgia and sleep disorder

View Set

Chapter 4 International Business

View Set

SSE 200 Foundations of Economics Chapter 5-6 (Test 3)

View Set

Child and Adolescent Development Exam 2

View Set

Upper GI Disorder (Chapt 23) MCQs

View Set

Personal Trainer-Module 4 Muscular System Anatomy & Exercise Science

View Set