Deck 3: The Efficiency of Algorithms
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
Play
Full screen (f)
Deck 3: The Efficiency of Algorithms
1
The selection sort algorithm can recognize whether or not the list is already sorted at the beginning.
False
2
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 that the loop is executed approximately n times.
False
3
The time an algorithm takes on a particular machine is important for comparing two algorithms that do the same task.
False
4
If an Q (n2) algorithm and an Q (n) algorithm exist for the same task, then for large enough n, the Q (n2) algorithm does more work and takes longer to execute, regardless of the constant factors for peripheral work.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
The shuffle-left algorithm is not space-efficient.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
Of all the desirable properties for algorithms, efficiency is the most easily quantifiable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
Ease of understanding, elegance, efficiency, and correctness are all characteristics of a good algorithm.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
With sequential search, the bigger the list of items, the more work that must be done to search it.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
A computer program is often written to be used only once to solve a single instance of a problem.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
The brute-force bin-packing algorithm is very useful.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
The sequential search and selection sort algorithms are different methods to get the same thing done.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
Binary search uses significantly more space than sequential search.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
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.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
Anything that varies as a constant times n is said to be of order of magnitude n.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
The time/space tradeoff is the choice between algorithms where you gain something while giving up something else.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
It is sufficient for an algorithm to provide correct results for only the input values that we expect are the most likely to occur.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
The selection sort algorithm does exchanges, in addition to comparisons.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
Given a sorted list, the sequential search algorithm is more efficient than the binary search.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
Sequential search is an order-n algorithm in the average case.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
Elegance is the first and foremost expectation of a proper algorithm.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
The shuffle-left algorithm is a(n) ____ algorithm in the best case.
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
Some algorithms must do work that is not polynomially bounded.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
The properties that make better algorithms are very similar to the properties we look for when purchasing a car.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
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)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
The Hamiltonian problem is suspected to be intractable.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
The binary search algorithm is ____ in the worst case.
A) 1
B) Q (lg n)
C) Q (n)
D) Q (n2)
A) 1
B) Q (lg n)
C) Q (n)
D) Q (n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
A collection of sets and vectors is called a graph.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
The ____ case of an algorithm requires the minimum amount of work.
A) best
B) worst
C) smallest
D) largest
A) best
B) worst
C) smallest
D) largest
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
____ is the term to describe an algorithm's careful use of resources.
A) Resourcefulness
B) Time-Space Tradeoff
C) Effectiveness
D) Efficiency
A) Resourcefulness
B) Time-Space Tradeoff
C) Effectiveness
D) Efficiency
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The converging-pointers algorithm is ____ in the best case.
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
Sequential search is a(n) ____ algorithm in the worst case.
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
____ is the algorithmic equivalence of style.
A) Efficiency
B) Elegance
C) Aesthetics
D) Complexity
A) Efficiency
B) Elegance
C) Aesthetics
D) Complexity
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
Selection sort is a(n) ____ algorithm in all cases.
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
The study of the efficiency of various algorithms is called the ____ of algorithms.
A) design
B) analysis
C) implementation
D) testing
A) design
B) analysis
C) implementation
D) testing
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
The copy-over algorithm is ____ in time efficiency in the worst case.
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
A) 1
B) Q (n)
C) Q (2n)
D) Q (n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
The number of times a number n can be divided by 2 and not go below 1 is called the logarithm of n to the base 3.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
____ is the fixing of errors uncovered through repeated use of an algorithm.
A) Program maintenance
B) Recycling
C) Data cleanup
D) Garbage collection
A) Program maintenance
B) Recycling
C) Data cleanup
D) Garbage collection
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
____ algorithms are an alternative approach for problems which no known polynomial solution algorithm exists.
A) Alternative
B) Intractable
C) Polynomial
D) Approximation
A) Alternative
B) Intractable
C) Polynomial
D) Approximation
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
A ____ is a path through a graph that begins and ends on the same node and goes through every node exactly once.
A) Newtonian loop
B) McCarthian path
C) Hamiltonian circuit
D) complete trip
A) Newtonian loop
B) McCarthian path
C) Hamiltonian circuit
D) complete trip
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
When does the worst case in binary search occur?
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
The process of timing an algorithm using the same machine but searching for different items is called ____.
A) time trials
B) benchmarking
C) comparison timing
D) intensive testing
A) time trials
B) benchmarking
C) comparison timing
D) intensive testing
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
What is the unit of work in the data cleanup algorithm?
A) comparisons and exchanges
B) comparisons only
C) examinations and copies
D) character comparisons
A) comparisons and exchanges
B) comparisons only
C) examinations and copies
D) character comparisons
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
Why would an exponential algorithm be useless with a large input, n?
A) It would take too long to compute
B) It would take too much space
C) It would not be correct
D) It would not be elegant
A) It would take too long to compute
B) It would take too much space
C) It would not be correct
D) It would not be elegant
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
The problem of placing objects in alphabetical or numerical order is called ____.
A) simplifying
B) searching
C) sorting
D) pattern matching
A) simplifying
B) searching
C) sorting
D) pattern matching
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
An algorithm with order of magnitude Q (n2) grows at the ____ of the rate of the problem size n.
A) square
B) cube
C) logarithm
D) fraction
A) square
B) cube
C) logarithm
D) fraction
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
Q (n) and Q (n2) 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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck