Algorithm Analysis Practice Quiz
Which of the following is a Big-θ of the following equation? 2^N-4N^2
2^N
What asymptotic notation states that an algorithm will not perform worse than some function?
Big-Oh (Ο)
Which type of analysis gives you an exact estimation of the algorithm performance?
Big-Theta (Θ)
Why is algorithm analysis important in software development?
Effort spent trying to improve algorithms that are already efficient is not wasted, since if an improvement is found, the improved algorithm can be stored and reused later. Sometimes it is necessary to optimize an algorithm even to gain a small improvement in the running time Some inefficient algorithms may not be able to solve problems beyond a trivial size in a reasonable amount of time
In determining an algorithm's efficiency, space consumption should be ignored.
False
Which of the following is a Big-Ω of the function? N^2 - 4
N
Of the following choices, which algorithm is the fastest?
N^2 Log N
Which of the following is a Big-O of the function? 2N^3+4N
N^4
Which of the following shows a list of Big-O running times from slowest to fastest?
O(N!) -> O(2^N) -> O(N^2) -> O(N) -> O(Log N)
The less efficient the algorithm, the steeper the slope of its running time when plotted against its input size (N).
True
When simply determining the order of magnitude of an algorithm using Big-Oh algorithm analysis, an algorithm that evaluates to O(c) is equal to one that evaluates to O(1) because both have constant running time.
True
In which of the following cases might Big-Oh analysis give an inaccurate representation of the efficiency of an algorithm in practice? (Select all that apply.)
When the number of items ot be processed is very small. When the worst case scenario can be proven to occur very rarely. When the algorithm needs to access data from an external device or network.
Which of the following growth-rate functions would correspond to the longest running time?
exponential
What is the common name for the growth rate function N?
linear
What is the common name for the growth rate function Log N?
logarithmic
Which of the following growth rate functions are exponential?
10^N 3^N
Which of the following growth rate functions are linear?
0.5N 106N
Which of the following growth rate functions are constant?
1 104 55!