Deck 2: Analysis of Algorithms

Full screen (f)
exit full mode
Question
What is the order of the following growth function? t(n)= 5nlogn + 20n - 4

A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Use Space or
up arrow
down arrow
to flip the card.
Question
The following code segment has ______ time complexity? <strong>The following code segment has ______ time complexity?  </strong> A) O(1) B) O(n) C) O(n<sup>2</sup>) D) O(nlogn) <div style=padding-top: 35px>

A) O(1)
B) O(n)
C) O(n2)
D) O(nlogn)
Question
Which Growth function has the highest order?

A) O(n log n)
B) O(n2)
C) O(2n)
D) O(log n)
Question
What is the time complexity of the following loop?
<strong>What is the time complexity of the following loop?  </strong> A) O(n<sup>2</sup>) B) O(n<sup>3</sup>) C) O(n) D) O(2<sup>n</sup>) <div style=padding-top: 35px>

A) O(n2)
B) O(n3)
C) O(n)
D) O(2n)
Question
Which of the following has the smallest time complexity?

A) 3n+5+2n
B) Logn + 2
C) 3n+4
D) n logn
Question
What does a growth function show?

A) How big a program must be before completed
B) How many times a program can be re used
C) Time or space utilization relative to the problem size
D) How many lines a program is
Question
Software must make efficient use of resources such as _______ and _______ .

A) Hard Drive, Video Card
B) CPU time, Memory
C) CPU time, Video Card
D) Memory, Hard Drive
Question
What is the O(_) of this growth function? ______
3n4+n2+3n-867.5309
Question
A __ function shows time or space utilization relative to the problem size.
Question
Algorithm ______ is a fundamental computer science topic.
Question
The ______ of an algorithm is found by eliminating constants and all but the
dominant term in the algorithm's growth function.
Question
The order of an algorithm provides an ______ to the algorithm's
growth function.
Question
If the algorithm is ______, a faster processor will not help in the long run.
Question
The time complexity of a loop is found by multiplying the complexity of the
______ by how many times the loop will execute.
Question
The analysis of nested loops must take into account both the ______.
Question
The order of an algorithm refers to the ______ of the algorithm's growth function.
Question
The order of an algorithm is found by eliminating constants and all but the dominant term in the algorithm's growth function.
Question
Speeding up the processor by a factor of 10 will increase the processing speed by a factor of 10 regardless of the efficiency of the algorithm.
Question
A growth function shows time or space utilization relative to the problem size.
Question
Software must make efficient use of resources such as CPU time and memory.
Question
The order of an algorithm provides a lower bound to the algorithm's growth function.
Question
If the algorithm is inefficient, a faster processor will help.
Question
The time complexity of a loop is found by multiplying the complexity of the body of the loop by how many times the loop will execute.
Question
The analysis of nested loops must take into account both the inner and outer loops.
Question
The order of an algorithm refers to the asymptotic complexity of the algorithm's growth function.
Question
Method calls are always O(n).
Question
What is the difference between the growth function of an algorithm and the order of that algorithm?
Question
Why does speeding up the CPU not necessarily speed up the process by the same amount?
Question
How do we use the growth function of an algorithm to determine its order?
Question
How do we determine the time complexity of a loop?
Question
How do we determine the time complexity of a method call?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/31
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 2: Analysis of Algorithms
1
What is the order of the following growth function? t(n)= 5nlogn + 20n - 4

A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
O(n log n)
2
The following code segment has ______ time complexity? <strong>The following code segment has ______ time complexity?  </strong> A) O(1) B) O(n) C) O(n<sup>2</sup>) D) O(nlogn)

A) O(1)
B) O(n)
C) O(n2)
D) O(nlogn)
O(nlogn)
3
Which Growth function has the highest order?

A) O(n log n)
B) O(n2)
C) O(2n)
D) O(log n)
O(2n)
4
What is the time complexity of the following loop?
<strong>What is the time complexity of the following loop?  </strong> A) O(n<sup>2</sup>) B) O(n<sup>3</sup>) C) O(n) D) O(2<sup>n</sup>)

A) O(n2)
B) O(n3)
C) O(n)
D) O(2n)
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
5
Which of the following has the smallest time complexity?

A) 3n+5+2n
B) Logn + 2
C) 3n+4
D) n logn
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
6
What does a growth function show?

A) How big a program must be before completed
B) How many times a program can be re used
C) Time or space utilization relative to the problem size
D) How many lines a program is
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
7
Software must make efficient use of resources such as _______ and _______ .

A) Hard Drive, Video Card
B) CPU time, Memory
C) CPU time, Video Card
D) Memory, Hard Drive
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
8
What is the O(_) of this growth function? ______
3n4+n2+3n-867.5309
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
9
A __ function shows time or space utilization relative to the problem size.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
10
Algorithm ______ is a fundamental computer science topic.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
11
The ______ of an algorithm is found by eliminating constants and all but the
dominant term in the algorithm's growth function.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
12
The order of an algorithm provides an ______ to the algorithm's
growth function.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
13
If the algorithm is ______, a faster processor will not help in the long run.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
14
The time complexity of a loop is found by multiplying the complexity of the
______ by how many times the loop will execute.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
15
The analysis of nested loops must take into account both the ______.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
16
The order of an algorithm refers to the ______ of the algorithm's growth function.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
17
The order of an algorithm is found by eliminating constants and all but the dominant term in the algorithm's growth function.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
18
Speeding up the processor by a factor of 10 will increase the processing speed by a factor of 10 regardless of the efficiency of the algorithm.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
19
A growth function shows time or space utilization relative to the problem size.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
20
Software must make efficient use of resources such as CPU time and memory.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
21
The order of an algorithm provides a lower bound to the algorithm's growth function.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
22
If the algorithm is inefficient, a faster processor will help.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
23
The time complexity of a loop is found by multiplying the complexity of the body of the loop by how many times the loop will execute.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
24
The analysis of nested loops must take into account both the inner and outer loops.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
25
The order of an algorithm refers to the asymptotic complexity of the algorithm's growth function.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
26
Method calls are always O(n).
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
27
What is the difference between the growth function of an algorithm and the order of that algorithm?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
28
Why does speeding up the CPU not necessarily speed up the process by the same amount?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
29
How do we use the growth function of an algorithm to determine its order?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
30
How do we determine the time complexity of a loop?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
31
How do we determine the time complexity of a method call?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 31 flashcards in this deck.