Deck 3: The Efficiency of Algorithms
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
العب
ملء الشاشة (f)
Deck 3: The Efficiency of Algorithms
1
The time an algorithm takes on a particular machine is the best way for comparing two algorithms that do the same task.
False
2
Sequential search is an order-n algorithm in the average case.
True
3
____ involves the fixing of errors that are uncovered through repeated usage with different input values.
A) Program maintenance
B) Recycling
C) Data cleanup
D) Garbage collection
A) Program maintenance
B) Recycling
C) Data cleanup
D) Garbage collection
A
4
No one has yet found a solution algorithm that works in polynomial time, but neither has anyone proved that such an algorithm does not exist.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
Binary search uses significantly more space than sequential search.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
If we were to run the sequential search algorithm many times, with random input values occurring at various places in the list, we would find the average number of comparisons done to be approximately n/2.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
A collection of nodes and connecting edges is called a(n) vector. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
The selection sort algorithm can recognize whether or not the list is already sorted at the beginning.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
Given a sorted list, the sequential search algorithm is more efficient than the binary search.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
The shuffle-left algorithm is not space-efficient. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
The properties that make better algorithms are very similar to the properties we look for when purchasing a car.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
In the sequential search algorithm, the minimum amount of work is done if the value being searched for is the ____ value in the list.
A) first
B) second
C) middle
D) last
A) first
B) second
C) middle
D) last
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
In the sequential search algorithm, the worst case occurs when the value being searched for is the first value in the list. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
With sequential search, the bigger the list of items, the more work that must be done to search it. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
____ is the algorithmic equivalence of style.
A) Efficiency
B) Elegance
C) Aesthetics
D) Complexity
A) Efficiency
B) Elegance
C) Aesthetics
D) Complexity
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
The study of the efficiency of algorithms is called the ____ of algorithms.
A) design
B) analysis
C) implementation
D) testing
A) design
B) analysis
C) implementation
D) testing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
____ are useful for rating one machine against another and for rating how sensitive a particular algorithm is with respect to variations in input on one particular machine.
A) Time trials
B) Benchmarks
C) Comparison times
D) Intensive tests
A) Time trials
B) Benchmarks
C) Comparison times
D) Intensive tests
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
If an Q(n²) algorithm and an Q(n) algorithm exist for the same task, then for large enough n, the Q(n²) algorithm does more work and takes longer to execute, regardless of the constant factors for peripheral work.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
First and foremost, we expect elegance from our algorithms. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
The sequential search and selection sort algorithms are different methods to get the same thing done.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
The ____ case of an algorithm requires the least work.
A) best
B) worst
C) smallest
D) largest
A) best
B) worst
C) smallest
D) largest
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
Binary search does ____ comparisons in the worst case.
A) Q(1)
B) Q(lg n)
C) Q(n)
D) Q(n2)
A) Q(1)
B) Q(lg n)
C) Q(n)
D) Q(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
An ____ algorithm is called an exponential algorithm.
A) Q(lg n)
B) Q(n)
C) Q(n2)
D) Q(2n)
A) Q(lg n)
B) Q(n)
C) Q(n2)
D) Q(2n)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
The copy-over algorithm is ____ in time efficiency in the worst case.
A) Q(1)
B) Q(n)
C) Q(2n)
D) Q(n2)
A) Q(1)
B) Q(n)
C) Q(2n)
D) Q(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
Problems for which no known polynomial solution algorithm exists are sometimes approached via ____ algorithms.
A) alternative
B) intractable
C) polynomial
D) approximation
A) alternative
B) intractable
C) polynomial
D) approximation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
The worst case in binary search occurs ____.
A) when the object to be searched is in the middle of the list
B) when the object to be searched is at the end of the list
C) when the object to be searched is at the beginning of the list
D) when the object to be searched is not in the list
A) when the object to be searched is in the middle of the list
B) when the object to be searched is at the end of the list
C) when the object to be searched is at the beginning of the list
D) when the object to be searched is not in the list
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
____________________ is the term to describe an algorithm's careful use of resources.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
A(n) ____________________ is a path through a graph that begins and ends at the same node and goes through all other nodes exactly once.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
Q(lg n), Q(n) and Q(n²) are ____ in the amount of work they do as n increases.
A) restricted
B) useful
C) polynomially bounded
D) exponential
A) restricted
B) useful
C) polynomially bounded
D) exponential
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
A surprising number of problems fall into the "____" category.
A) suspected intractable
B) approximation algorithm
C) bin-packing
D) declared intractable
A) suspected intractable
B) approximation algorithm
C) bin-packing
D) declared intractable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
The ____ sort algorithm performs the task of sorting a list by growing a sorted subsection of the list from the back to the front.
A) selection
B) sequential
C) shuffle-left
D) binary
A) selection
B) sequential
C) shuffle-left
D) binary
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
In the sequential search algorithm, the worst case occurs when the value being searched for is the ____ value in the list.
A) first
B) second
C) middle
D) last
A) first
B) second
C) middle
D) last
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
The shuffle-left algorithm is a(n) ____ algorithm in the worst case.
A) Q(1)
B) Q(n)
C) Q(2n)
D) Q(n2)
A) Q(1)
B) Q(n)
C) Q(2n)
D) Q(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
Selection sort is a(n) ____ algorithm in all cases.
A) Q(1)
B) Q(n)
C) Q(2n)
D) Q(n2)
A) Q(1)
B) Q(n)
C) Q(2n)
D) Q(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
Part of the job of program ____ is to make clear any assumptions or restrictions about the input size the program was designed to handle.
A) design
B) implementation
C) documentation
D) maintenance
A) design
B) implementation
C) documentation
D) maintenance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
____________________ problems are solvable, but the solution algorithms all require so much work as to be virtually useless.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
The number of comparisons done by the selection sort algorithm does not grow at the same rate as the problem size n, instead it grows at approximately the ____________________ of that rate.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
Placing a list of items into alphabetical or numerical order is called ____.
A) simplifying
B) searching
C) sorting
D) pattern matching
A) simplifying
B) searching
C) sorting
D) pattern matching
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
Sequential search is a(n) ____ algorithm in the worst case.
A) Q(1)
B) Q(n)
C) Q(2n)
D) Q(n2)
A) Q(1)
B) Q(n)
C) Q(2n)
D) Q(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
The converging-pointers algorithm is Q(n) in the ____________________ case.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
What is the definition of order of magnitude n?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
Discuss at length the "people aspect" of the practical considerations for the development of algorithms. Include the concepts of program maintenance and ease of understanding in your response.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
What is the logarithm of n to the base 2?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
If an algorithm is more time efficient and less space efficient, what is this called?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
Explain the sentence: The selection sort algorithm not only does comparisons; it also does exchanges.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
Discuss at length the measurement of the time and space consumed by an algorithm in order to determine its efficiency.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
Discuss at length both the best and worst case of the pattern-matching algorithm.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
Discuss at length how binary search operates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
How do you approach problems for which no known polynomial solution algorithm exists?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
Given the data cleanup problem described in the text, write the pseudocode for the converging-pointers algorithm for data cleanup.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck