Deck 13: Recursion

ملء الشاشة (f)
exit full mode
سؤال
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.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
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
سؤال
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 a solution using recursion is more evident than a solution using a loop.
سؤال
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
سؤال
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 functions are _____ iterative algorithms.

A) more efficient than
B) less efficient than
C) as efficient as
D) incomparable to
سؤال
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 recursive function includes _____ which are not necessary in a loop structure.

A) function calls
B) conditional clauses
C) overhead actions
D) object instances
سؤال
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 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
سؤال
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.
سؤال
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
سؤال
A recursive function must have some way to control the number of times it repeats.
سؤال
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.
سؤال
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
سؤال
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
سؤال
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
سؤال
A base case is not necessary for all recursive algorithms.
سؤال
Recursive algorithms are more concise and efficient than iterative algorithms.
سؤال
The majority of repetitive programming tasks are best done with _______________.
سؤال
A function is called from the main function and then it calls itself five times. The depth of recursion is _______________.
سؤال
A recursion in which a function directly calls itself is known as _______________ recursion.
سؤال
A solution using a(n) _______________ is usually more evident than a recursive solution.
سؤال
Each time a function is called, the system incurs overhead that is not necessary with a loop.
سؤال
Recursive function calls are _______________ efficient than loops.
سؤال
When function A calls function B, which in turn calls function A, it is known as indirect recursion.
سؤال
The base case does not require _______________, so it stops the chain of recursive calls.
سؤال
All the cases of the recursive solution other than the base case are called the _______________ case.
سؤال
Some problems are _______________ solved with recursion than with a loop.
سؤال
Recursion is required to solve some type of problems.
سؤال
Each time a function is called, the system incurs _______________ that is not necessary with a loop.
سؤال
Usually, a problem is reduced by making the value of one or more parameters _______________ with each recursive call.
سؤال
A problem can be solved with recursion if it can be broken into smaller problems that are identical in structure to the overall problem.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 13: Recursion
1
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
2
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
3
A problem can be solved with recursion if it can be broken down into _____ problems.

A) smaller
B) one-line
C) manageable
D) modular
A
4
In many cases a solution using recursion is more evident than a solution using a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
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
6
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
7
Recursive functions are _____ iterative algorithms.

A) more efficient than
B) less efficient than
C) as efficient as
D) incomparable to
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
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
9
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
10
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
11
There can be several functions involved in the recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
12
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
13
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
14
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
15
A recursive function must have some way to control the number of times it repeats.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
16
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
17
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
18
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
19
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
20
A base case is not necessary for all recursive algorithms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
21
Recursive algorithms are more concise and efficient than iterative algorithms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
22
The majority of repetitive programming tasks are best done with _______________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 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
A recursion in which a function directly calls itself is known as _______________ recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
25
A solution using a(n) _______________ is usually more evident than a recursive solution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
26
Each time a function is called, the system incurs overhead that is not necessary with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
27
Recursive function calls are _______________ efficient than loops.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
28
When function A calls function B, which in turn calls function A, it is known as indirect recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
29
The base case does not require _______________, so it stops the chain of recursive calls.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
30
All the cases of the recursive solution other than the base case are called the _______________ case.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
31
Some problems are _______________ solved with recursion than with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
32
Recursion is required to solve some type of problems.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
33
Each time a function is called, the system incurs _______________ that is not necessary with a loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
34
Usually, a problem is reduced by making the value of one or more parameters _______________ with each recursive call.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
35
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
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.