1.Easy
Which of these running times is polynomial?
- AO(n!)
- BO(2ⁿ)
- CO(n³)
- DO(nⁿ)
2.Easy
How much extra memory does a standard array-based merge sort use?
- AO(log n)
- BO(n²)
- CO(1)
- DO(n)
3.Easy
What does f(n) = Θ(g(n)) mean?
- Af is always smaller than g for every n, so g bounds it from above but never from below
- Bf grows at the same rate as g, bounded above and below by constant multiples of g
- Cf grows strictly faster than g
- Df grows strictly slower than g
4.Medium
What does the recurrence T(n) = T(n − 1) + O(n) solve to?
- AO(n log n)
- BO(n)
- CO(2ⁿ)
- DO(n²)
5.Medium
Why is the base of a logarithm usually left out in Big O, as in O(log n)?
- ALogarithms with different bases differ only by a constant factor
- BThe base only matters for small n
- CAll logarithms in computer science have base 10, so it is implied
- DLogarithms are always rounded to integers
6.Medium
What does the recurrence T(n) = 2T(n − 1) + O(1) solve to?
- AO(n log n)
- BO(n)
- CO(n²)
- DO(2ⁿ)
7.Hard
Topological sorting is possible only for:
- AComplete graphs
- BUndirected graphs
- CDirected acyclic graphs
- DGraphs with negative weights
8.Hard
Strassen's algorithm multiplies matrices using 7 instead of 8 recursive multiplications of half-size blocks. What is its running time?
- AΘ(n³)
- BΘ(n2)
- CΘ(n² log n)
- DΘ(nlog₂ 7), about n2.81
Answer key
- 1. C · O(n³)
- 2. D · O(n)
- 3. B · f grows at the same rate as g, bounded above and below by constant multiples of g
- 4. D · O(n²)
- 5. A · Logarithms with different bases differ only by a constant factor
- 6. D · O(2ⁿ)
- 7. C · Directed acyclic graphs
- 8. D · Θ(nlog₂ 7), about n2.81
Full step-by-step solutions: practise this topic on examproblems.com.