Deck 12: Recursion

ملء الشاشة (f)
exit full mode
سؤال
Each time a function is called in a recursive solution,the system incurs overhead that is not incurred with a loop.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
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
سؤال
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
سؤال
What is the first 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 solve the problem in all circumstances using recursion.
C) Identify a way to stop the recursion.
D) Determine a way to return to the main function.
سؤال
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.
سؤال
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.
سؤال
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
سؤال
There must be only one function involved in any recursive solution.
سؤال
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
سؤال
The base case is the case in which the problem can be solved without

A) loops
B) decisions
C) objects
D) recursion
سؤال
A recursive function must have some way to control the number of times it repeats.
سؤال
When,in a recursive solution,function A calls function B which,in turn,calls function A,this is known as indirect recursion.
سؤال
Recursion is sometimes required to solve certain types of problems.
سؤال
Which of the following describes the base case in a recursive solution?

A) a case in which the problem can be solved without recursion
B) the case in which the problem is solved through recursion
C) the way to stop the recursion
D) the way to return to the main function
سؤال
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.
سؤال
Recursion is

A) never required to solve a problem
B) required to solve certain mathematical problems
C) sometimes required to solve string problems
D) required to solve some problems
سؤال
A base case is not necessary for all recursive algorithms.
سؤال
Recursive algorithms are always more concise and efficient than iterative algorithms.
سؤال
A problem can be solved with recursion if it can be broken down into __________ problems.

A) smaller
B) one-line
C) manageable
D) modular
سؤال
In many cases it is easier to see how to solve a problem with recursion than with a loop.
سؤال
A recursion in which a function directly calls itself is known as ___________ recursion.
سؤال
Recursive function calls are __________ efficient than loops.
سؤال
A function is called from the main function and then it calls itself five times.
The depth of recursion is __________.
سؤال
The majority of repetitive programming tasks are best done with ___________.
سؤال
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
سؤال
A recursive function includes __________ which are not necessary in a loop structure.

A) function calls
B) conditional clauses
C) overhead actions
D) object instances
سؤال
Recursive functions are __________ iterative algorithms.

A) more efficient than
B) less efficient than
C) as efficient as
D) impossible to compare to
سؤال
Some problems are more __________ solved with recursion than with a loop.
سؤال
What defines the depth of recursion?

A) the length of the algorithm
B) the number of function calls
C) the number of times the function calls itself
D) the number of times the function goes to the base case
سؤال
All the cases of a recursive solution other than the base case are called the __________ case.
سؤال
A solution using a(n)__________ is usually more evident than a recursive solution.
سؤال
Usually a problem solved by recursion is reduced by making the value of one or more parameters __________ with each recursive call.
سؤال
Which would be the base case in a recursive solution to the problem of finding the factorial of a number. Recall that the factorial of a non-negative whole number is defined as n! where:
If n = 0,then n! = 1
If n > 0,then n! = 1 x 2 x 3 x ...
X n

A) n = 0
B) n = 1
C) n > 0
D) The factorial of a number cannot be solved with recursion.
سؤال
The base case does not require __________,so it stops the chain of recursive calls.
سؤال
Each time a function is called,the system incurs __________ that is not necessary with a loop.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 12: Recursion
1
Each time a function is called in a recursive solution,the system incurs overhead that is not incurred with a loop.
True
2
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
D
3
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
C
4
What is the first 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 solve the problem in all circumstances using recursion.
C) Identify a way to stop the recursion.
D) Determine a way to return to the main function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
6
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
7
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
There must be only one function involved in any recursive solution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
9
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
10
The base case is the case in which the problem can be solved without

A) loops
B) decisions
C) objects
D) recursion
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
11
A recursive function must have some way to control the number of times it repeats.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
12
When,in a recursive solution,function A calls function B which,in turn,calls function A,this is known as indirect recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
13
Recursion is sometimes required to solve certain types of problems.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
14
Which of the following describes the base case in a recursive solution?

A) a case in which the problem can be solved without recursion
B) the case in which the problem is solved through recursion
C) the way to stop the recursion
D) the way to return to the main function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
15
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
16
Recursion is

A) never required to solve a problem
B) required to solve certain mathematical problems
C) sometimes required to solve string problems
D) required to solve some problems
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
17
A base case is not necessary for all recursive algorithms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
18
Recursive algorithms are always more concise and efficient than iterative algorithms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
19
A problem can be solved with recursion if it can be broken down into __________ problems.

A) smaller
B) one-line
C) manageable
D) modular
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
20
In many cases it is easier to see how to solve a problem with recursion than with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
21
A recursion in which a function directly calls itself is known as ___________ recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
22
Recursive function calls are __________ efficient than loops.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
23
A function is called from the main function and then it calls itself five times.
The depth of recursion is __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
24
The majority of repetitive programming tasks are best done with ___________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
25
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
26
A recursive function includes __________ which are not necessary in a loop structure.

A) function calls
B) conditional clauses
C) overhead actions
D) object instances
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
27
Recursive functions are __________ iterative algorithms.

A) more efficient than
B) less efficient than
C) as efficient as
D) impossible to compare to
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
28
Some problems are more __________ solved with recursion than with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
29
What defines the depth of recursion?

A) the length of the algorithm
B) the number of function calls
C) the number of times the function calls itself
D) the number of times the function goes to the base case
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
30
All the cases of a recursive solution other than the base case are called the __________ case.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
31
A solution using a(n)__________ is usually more evident than a recursive solution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
32
Usually a problem solved by recursion is reduced by making the value of one or more parameters __________ with each recursive call.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
33
Which would be the base case in a recursive solution to the problem of finding the factorial of a number. Recall that the factorial of a non-negative whole number is defined as n! where:
If n = 0,then n! = 1
If n > 0,then n! = 1 x 2 x 3 x ...
X n

A) n = 0
B) n = 1
C) n > 0
D) The factorial of a number cannot be solved with recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
34
The base case does not require __________,so it stops the chain of recursive calls.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
35
Each time a function is called,the system incurs __________ that is not necessary with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.