Deck 3: The Efficiency of Algorithms

Full screen (f)
exit full mode
Question
Sequential search is an order-n algorithm in the average case.
Use Space or
up arrow
down arrow
to flip the card.
Question
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.
Question
The selection sort algorithm can recognize whether or not the list is already sorted at the beginning.
Question
The study of the efficiency of algorithms is called the ____ of algorithms.

A) design
B) analysis
C) implementation
D) testing
Question
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.
Question
First and foremost, we expect elegance from our algorithms._________________________
Question
With sequential search, the bigger the list of items, the more work that must be done to search it._________________________
Question
In the sequential search algorithm, the worst case occurs when the value being searched for is the first value in the list._________________________
Question
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
Question
A collection of nodes and connecting edges is called a(n) vector._________________________
Question
The properties that make better algorithms are very similar to the properties we look for when purchasing a car.
Question
____ 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
Question
If an Θ(n2) algorithm and an Θ(n) algorithm exist for the same task, then for large enough n, the Θ(n2) algorithm does more work and takes longer to execute, regardless of the constant factors for peripheral work.
Question
The sequential search and selection sort algorithms are different methods to get the same thing done.
Question
The shuffle-left algorithm is not space-efficient._________________________
Question
____ 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
Question
The time an algorithm takes on a particular machine is the best way for comparing two algorithms that do the same task.
Question
Given a sorted list, the sequential search algorithm is more efficient than the binary search.
Question
____ is the algorithmic equivalence of style.

A) Efficiency
B) Elegance
C) Aesthetics
D) Complexity
Question
Binary search uses significantly more space than sequential search.
Question
Sequential search is a(n) ____ algorithm in the worst case.

A) Θ(1)
B) Θ(n)
C) Θ(2n)
D) Θ(n2)
Question
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
Question
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
Question
The copy-over algorithm is ____ in time efficiency in the worst case.

A) Θ(1)
B) Θ(n)
C) Θ(2n)
D) Θ(n2)
Question
An ____ algorithm is called an exponential algorithm.

A) Θ(lg n)
B) Θ(n)
C) Θ(n2)
D) Θ(2n)
Question
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
Question
The converging-pointers algorithm is Θ(n) in the ____________________ case.
Question
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
Question
Binary search does ____ comparisons in the worst case.

A) Θ(1)
B) Θ(lg n)
C) Θ(n)
D) Θ(n2)
Question
The shuffle-left algorithm is a(n) ____ algorithm in the worst case.

A) Θ(1)
B) Θ(n)
C) Θ(2n)
D) Θ(n2)
Question
____________________ is the term to describe an algorithm's careful use of resources.
Question
A(n) ____________________ is a path through a graph that begins and ends at the same node and goes through all other nodes exactly once.
Question
The ____ case of an algorithm requires the least work.

A) best
B) worst
C) smallest
D) largest
Question
____________________ problems are solvable, but the solution algorithms all require so much work as to be virtually useless.
Question
Θ(lg n), Θ(n) and Θ(n2) are ____ in the amount of work they do as n increases.

A) restricted
B) useful
C) polynomially bounded
D) exponential
Question
Problems for which no known polynomial solution algorithm exists are sometimes approached via ____ algorithms.

A) alternative
B) intractable
C) polynomial
D) approximation
Question
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.
Question
Placing a list of items into alphabetical or numerical order is called ____.

A) simplifying
B) searching
C) sorting
D) pattern matching
Question
Selection sort is a(n) ____ algorithm in all cases.

A) Θ(1)
B) Θ(n)
C) Θ(2n)
D) Θ(n2)
Question
A surprising number of problems fall into the "____" category.

A) suspected intractable
B) approximation algorithm
C) bin-packing
D) declared intractable
Question
If an algorithm is more time efficient and less space efficient, what is this called?
Question
Discuss at length the measurement of the time and space consumed by an algorithm in order to determine its efficiency.
Question
Explain the sentence: The selection sort algorithm not only does comparisons; it also does exchanges.
Question
How do you approach problems for which no known polynomial solution algorithm exists?
Question
Explain the term "brute force" as it applies to algorithms.
Question
Given the data cleanup problem described in the text, write the pseudocode for the converging-pointers algorithm for data cleanup.
Question
What is the definition of order of magnitude n?
Question
Discuss at length both the best and worst case of the pattern-matching algorithm.
Question
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.
Question
What is the logarithm of n to the base 2?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: The Efficiency of Algorithms
1
Sequential search is an order-n algorithm in the average case.
True
2
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.
True
3
The selection sort algorithm can recognize whether or not the list is already sorted at the beginning.
False
4
The study of the efficiency of algorithms is called the ____ of algorithms.

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
5
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.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
First and foremost, we expect elegance from our algorithms._________________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
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
8
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
9
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
A collection of nodes and connecting edges is called a(n) vector._________________________
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
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
12
____ 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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
If an Θ(n2) algorithm and an Θ(n) algorithm exist for the same task, then for large enough n, the Θ(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
14
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
15
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
16
____ 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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
The time an algorithm takes on a particular machine is the best way for comparing two algorithms that do the same task.
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
____ is the algorithmic equivalence of style.

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
20
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
21
Sequential search is a(n) ____ algorithm in the worst case.

A) Θ(1)
B) Θ(n)
C) Θ(2n)
D) Θ(n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
The copy-over algorithm is ____ in time efficiency in the worst case.

A) Θ(1)
B) Θ(n)
C) Θ(2n)
D) Θ(n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
An ____ algorithm is called an exponential algorithm.

A) Θ(lg n)
B) Θ(n)
C) Θ(n2)
D) Θ(2n)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
The converging-pointers algorithm is Θ(n) in the ____________________ case.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
Binary search does ____ comparisons in the worst case.

A) Θ(1)
B) Θ(lg n)
C) Θ(n)
D) Θ(n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The shuffle-left algorithm is a(n) ____ algorithm in the worst case.

A) Θ(1)
B) Θ(n)
C) Θ(2n)
D) Θ(n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
____________________ is the term to describe an algorithm's careful use of resources.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
A(n) ____________________ is a path through a graph that begins and ends at the same node and goes through all other nodes exactly once.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
The ____ case of an algorithm requires the least work.

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
34
____________________ problems are solvable, but the solution algorithms all require so much work as to be virtually useless.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
Θ(lg n), Θ(n) and Θ(n2) are ____ in the amount of work they do as n increases.

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
36
Problems for which no known polynomial solution algorithm exists are sometimes approached via ____ algorithms.

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
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.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
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
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
Selection sort is a(n) ____ algorithm in all cases.

A) Θ(1)
B) Θ(n)
C) Θ(2n)
D) Θ(n2)
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
A surprising number of problems fall into the "____" category.

A) suspected intractable
B) approximation algorithm
C) bin-packing
D) declared intractable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
If an algorithm is more time efficient and less space efficient, what is this called?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
Discuss at length the measurement of the time and space consumed by an algorithm in order to determine its efficiency.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
Explain the sentence: The selection sort algorithm not only does comparisons; it also does exchanges.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
How do you approach problems for which no known polynomial solution algorithm exists?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
Explain the term "brute force" as it applies to algorithms.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
Given the data cleanup problem described in the text, write the pseudocode for the converging-pointers algorithm for data cleanup.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
What is the definition of order of magnitude n?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
Discuss at length both the best and worst case of the pattern-matching algorithm.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
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.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
What is the logarithm of n to the base 2?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.