Deck 19: Recursion

ملء الشاشة (f)
exit full mode
سؤال
The QuickSort algorithm was developed in 1960 by ________.

A)Bjarne Stroustrup
B)Tony Gaddis
C)C.A.R. Hoare
D)C.M. Turner
E)None of these
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Indirect recursion means that a function calls itself n number of times, then processing of the function starts from the first call.
سؤال
Recursive algorithms are less efficient than iterative algorithms.
سؤال
When function A calls function B, which in turn calls function A, this is known as:

A)direct recursion
B)indirect recursion
C)function swapping
D)perfect recursion
E)None of these
سؤال
When a recursive function directly calls itself, this is known as direct recursion.
سؤال
A ________ function is one that calls itself

A)dynamic
B)static
C)recursive
D)data validation
E)None of these
سؤال
A recursive function cannot call another function.
سؤال
If a recursive function does not contain a base case, it ________.

A)returns 0 and stops
B)returns false and stops
C)uses up all available stack memory, causing the program to crash
D)reaches the recursive case and stops
E)None of these
سؤال
The ________ algorithm uses recursion to efficiently sort a list.

A)shell sort
B)quicksort
C)binary sort
D)red/black sort
E)None of these
سؤال
The QuickSort algorithm is used to sort ________.

A)lists stored in arrays or linear linked lists
B)tree data structures
C)randomly-ordered files
D)All of these
E)None of these
سؤال
A recursive function is designed to terminate when it reaches its ________.

A)return statement
B)base case
C)closing curly brace
D)last parameter
E)None of these
سؤال
The recursive factorial function calculates the factorial of its parameter. Its base case is when the parameter is ________.

A)returned
B)received
C)amortized
D)zero
E)None of these
سؤال
The ________ of recursion is the number of times a recursive function calls itself.

A)level
B)breadth
C)type
D)depth
E)None of these
سؤال
The QuickSort algorithm works on the basis of

A)three sublists
B)two sublists and a pivot
C)two pivots and a sublist
D)three pivots
E)None of these
سؤال
Like a loop, a recursive function must have some method to control the number of times it repeats.
سؤال
Any algorithm that can be coded with recursion can also be coded with an iterative structure.
سؤال
The programmer must ensure that a recursive function does not become:

A)a static function
B)a virtual function
C)an endless loop
D)a dynamic function
E)None of these
سؤال
How many times will the following function call itself, if the value 5 is passed as the argument?
<strong>How many times will the following function call itself, if the value 5 is passed as the argument?  </strong> A)1 B)4 C)5 D)An infinite number of times <div style=padding-top: 35px>

A)1
B)4
C)5
D)An infinite number of times
سؤال
How many times will the following function call itself, if the value 5 is passed as the argument?
<strong>How many times will the following function call itself, if the value 5 is passed as the argument?  </strong> A)1 B)4 C)5 D)An infinite number of times <div style=padding-top: 35px>

A)1
B)4
C)5
D)An infinite number of times
سؤال
Recursion can be used to:

A)compute factorials
B)find GCD's
C)traverse linked lists
D)All of these
E)None of these
سؤال
The speed and amount of memory available to modern computers diminishes the performance impact of recursion so much that inefficiency is no longer a strong argument against it.
سؤال
When recursion is used on a linked list, it will always display the contents of the list in reverse order.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/22
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 19: Recursion
1
The QuickSort algorithm was developed in 1960 by ________.

A)Bjarne Stroustrup
B)Tony Gaddis
C)C.A.R. Hoare
D)C.M. Turner
E)None of these
C
2
Indirect recursion means that a function calls itself n number of times, then processing of the function starts from the first call.
False
3
Recursive algorithms are less efficient than iterative algorithms.
True
4
When function A calls function B, which in turn calls function A, this is known as:

A)direct recursion
B)indirect recursion
C)function swapping
D)perfect recursion
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
5
When a recursive function directly calls itself, this is known as direct recursion.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
6
A ________ function is one that calls itself

A)dynamic
B)static
C)recursive
D)data validation
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
7
A recursive function cannot call another function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
8
If a recursive function does not contain a base case, it ________.

A)returns 0 and stops
B)returns false and stops
C)uses up all available stack memory, causing the program to crash
D)reaches the recursive case and stops
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
9
The ________ algorithm uses recursion to efficiently sort a list.

A)shell sort
B)quicksort
C)binary sort
D)red/black sort
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
10
The QuickSort algorithm is used to sort ________.

A)lists stored in arrays or linear linked lists
B)tree data structures
C)randomly-ordered files
D)All of these
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
11
A recursive function is designed to terminate when it reaches its ________.

A)return statement
B)base case
C)closing curly brace
D)last parameter
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
12
The recursive factorial function calculates the factorial of its parameter. Its base case is when the parameter is ________.

A)returned
B)received
C)amortized
D)zero
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
13
The ________ of recursion is the number of times a recursive function calls itself.

A)level
B)breadth
C)type
D)depth
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
14
The QuickSort algorithm works on the basis of

A)three sublists
B)two sublists and a pivot
C)two pivots and a sublist
D)three pivots
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
15
Like a loop, a recursive function must have some method to control the number of times it repeats.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
16
Any algorithm that can be coded with recursion can also be coded with an iterative structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
17
The programmer must ensure that a recursive function does not become:

A)a static function
B)a virtual function
C)an endless loop
D)a dynamic function
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
18
How many times will the following function call itself, if the value 5 is passed as the argument?
<strong>How many times will the following function call itself, if the value 5 is passed as the argument?  </strong> A)1 B)4 C)5 D)An infinite number of times

A)1
B)4
C)5
D)An infinite number of times
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
19
How many times will the following function call itself, if the value 5 is passed as the argument?
<strong>How many times will the following function call itself, if the value 5 is passed as the argument?  </strong> A)1 B)4 C)5 D)An infinite number of times

A)1
B)4
C)5
D)An infinite number of times
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
20
Recursion can be used to:

A)compute factorials
B)find GCD's
C)traverse linked lists
D)All of these
E)None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
21
The speed and amount of memory available to modern computers diminishes the performance impact of recursion so much that inefficiency is no longer a strong argument against it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
22
When recursion is used on a linked list, it will always display the contents of the list in reverse order.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.