Deck 12: Recursion

ملء الشاشة (f)
exit full mode
سؤال
The process of calling a function requires _____.

A) a long 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
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
What is the first step that needs to be taken 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 other circumstances using recursion.
C) Identify a way to stop the recursion.
D) Determine a way to return to the main function.
سؤال
What is referred to as the recursive case?

A) At least one case in which the problem can be solved without recursion
B) A way to solve the problem in all other circumstances using recursion
C) The way to stop the recursion
D) The way to return to the main function
سؤال
What is referred to as the base case?

A) At least one case in which the problem can be solved without recursion
B) The circumstances to solve the problem using recursion
C) The way to stop the recursion
D) The way to return to the main function
سؤال
A function is called from the main function for the first time. It then calls itself seven times. What is the depth of recursion?

A) Eight
B) Two
C) One
D) Seven
سؤال
If a recursive solution is evident for a particular problem, and the recursive algorithm does not slow system performance by an intolerable amount, then recursion would be a good design choice.
سؤال
In many cases a solution using recursion is more evident than a solution using a loop.
سؤال
Function A calls function B, which calls function C, which calls function A. This is called _____ recursion.

A) continuous
B) direct
C) three function call
D) indirect
سؤال
The base case is a case in which the problem can be solved without _____.

A) loops
B) if
C) objects
D) recursion
سؤال
There can be several functions involved in the recursion.
سؤال
What is the second step that needs to be taken 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 in order to solve the problem in all circumstances which cannot be solved without recursion.
C) Identify a way to stop the recursion.
D) Determine a way to return to the main function.
سؤال
Recursive functions are _____ iterative algorithms.

A) more efficient than
B) less efficient than
C) as efficient as
D) incomparable to
سؤال
What defines the depth of recursion?

A) The length of the algorithm
B) The numbers of function calls
C) The number of times the function calls itself
D) The number of times it goes back to the main function
سؤال
A problem can be solved with recursion if it can be broken down into _____ problems.

A) smaller
B) one-line
C) manageable
D) modular
سؤال
Recursion is _____.

A) never required to solve a problem
B) required to solve mathematical problems
C) never required to solve string problems
D) required to solve some problems
سؤال
A recursive function must have some way to control the number of times it repeats.
سؤال
A recursive function includes _____ which are not necessary in a loop structure.

A) function calls
B) conditional clauses
C) overhead actions
D) object instances
سؤال
If the problem can be solved immediately without recursion, then the recursive function _____.

A) solves it and returns
B) Exits
C) returns the result
D) generates a run-time error
سؤال
A base case is not necessary for all recursive algorithms.
سؤال
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
سؤال
Recursive function calls are _______________ efficient than loops.
سؤال
The base case does not require _______________, so it stops the chain of recursive calls.
سؤال
Some problems are _______________ solved with recursion than with a loop.
سؤال
Each time a function is called, the system incurs _______________ that is not necessary with a loop.
سؤال
A solution using a(n) _______________ is usually more evident than a recursive solution.
سؤال
Recursive algorithms are more concise and efficient than iterative algorithms.
سؤال
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 _______________.
سؤال
Usually, a problem is reduced by making the value of one or more parameters _______________ with each recursive call.
سؤال
Recursion is required to solve some type of problems.
سؤال
A problem can be solved with recursion if it can be broken into smaller problems that are identical in structure to the overall problem.
سؤال
All the cases of the recursive solution other than the base case are called the _______________ case.
سؤال
A recursion in which a function directly calls itself is known as _______________ recursion.
سؤال
Each time a function is called, the system incurs overhead that is not necessary with a loop.
سؤال
When function A calls function B, which in turn calls function A, it is known as indirect recursion.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 12: Recursion
1
The process of calling a function requires _____.

A) a long 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
2
What is the first step that needs to be taken 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 other circumstances using recursion.
C) Identify a way to stop the recursion.
D) Determine a way to return to the main function.
A
3
What is referred to as the recursive case?

A) At least one case in which the problem can be solved without recursion
B) A way to solve the problem in all other circumstances using recursion
C) The way to stop the recursion
D) The way to return to the main function
B
4
What is referred to as the base case?

A) At least one case in which the problem can be solved without recursion
B) The circumstances to solve the problem using recursion
C) The way to stop the recursion
D) The way to return to the main function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
A function is called from the main function for the first time. It then calls itself seven times. What is the depth of recursion?

A) Eight
B) Two
C) One
D) Seven
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
6
If a recursive solution is evident for a particular problem, and the recursive algorithm does not slow system performance by an intolerable amount, then recursion would be a good design choice.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
7
In many cases a solution using recursion is more evident than a solution using a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
Function A calls function B, which calls function C, which calls function A. This is called _____ recursion.

A) continuous
B) direct
C) three function call
D) indirect
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
9
The base case is a case in which the problem can be solved without _____.

A) loops
B) if
C) objects
D) recursion
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
10
There can be several functions involved in the recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
11
What is the second step that needs to be taken 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 in order to solve the problem in all circumstances which cannot be solved without recursion.
C) Identify a way to stop the recursion.
D) Determine a way to return to the main function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
12
Recursive functions are _____ iterative algorithms.

A) more efficient than
B) less efficient than
C) as efficient as
D) incomparable to
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
13
What defines the depth of recursion?

A) The length of the algorithm
B) The numbers of function calls
C) The number of times the function calls itself
D) The number of times it goes back to the main function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
14
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
15
Recursion is _____.

A) never required to solve a problem
B) required to solve mathematical problems
C) never required to solve string problems
D) required to solve some problems
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
16
A recursive function must have some way to control the number of times it repeats.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
17
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
18
If the problem can be solved immediately without recursion, then the recursive function _____.

A) solves it and returns
B) Exits
C) returns the result
D) generates a run-time error
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
19
A base case is not necessary for all recursive algorithms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
20
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
21
Recursive function calls are _______________ efficient than loops.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
22
The base case does not require _______________, so it stops the chain of recursive calls.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
23
Some problems are _______________ solved with recursion than with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
24
Each time a function is called, the system incurs _______________ that is not necessary with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
25
A solution using a(n) _______________ is usually more evident than a recursive solution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
26
Recursive algorithms are more concise and efficient than iterative algorithms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
27
A function is called from the main function and then it calls itself five times. The depth of recursion is _______________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
28
The majority of repetitive programming tasks are best done with _______________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
29
Usually, a problem is reduced by making the value of one or more parameters _______________ with each recursive call.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
30
Recursion is required to solve some type of problems.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
31
A problem can be solved with recursion if it can be broken into smaller problems that are identical in structure to the overall problem.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
32
All the cases of the recursive solution other than the base case are called the _______________ case.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
33
A recursion in which a function directly calls itself is known as _______________ recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
34
Each time a function is called, the system incurs overhead that is not necessary with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
35
When function A calls function B, which in turn calls function A, it is known as indirect recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.