1.Easy
What does f(n) = Θ(g(n)) mean?
- Af grows strictly faster than g
- Bf is always smaller than g for every n, so g bounds it from above but never from below
- Cf grows at the same rate as g, bounded above and below by constant multiples of g
- Df grows strictly slower than g
2.Easy
What does the worst-case running time of an algorithm describe?
- AThe time it takes on a slow computer
- BThe expected time it takes on a random input of size n
- CThe time it takes on the smallest input
- DThe maximum time it takes over all inputs of size n
3.Easy
What is an algorithm?
- AAny computer program that has a graphical interface
- BA programming language designed for writing mathematical formulas
- CA finite sequence of well-defined steps that solves a problem
- DA data structure that stores numbers
4.Medium
Why is the base of a logarithm usually left out in Big O, as in O(log n)?
- ALogarithms are always rounded to integers
- BThe base only matters for small n
- CLogarithms with different bases differ only by a constant factor
- DAll logarithms in computer science have base 10, so it is implied
5.Medium
A greedy algorithm:
- AMakes the locally best choice at each step
- BAlways gives the optimal solution
- CUses only recursion
- DTries every possible solution
6.Medium
What does the recurrence T(n) = T(n − 1) + O(n) solve to?
- AO(n²)
- BO(2ⁿ)
- CO(n)
- DO(n log n)
7.Hard
What is the difference between an undecidable problem and an intractable one?
- AAn undecidable problem has no algorithm for all inputs; an intractable one has one, but it is too slow
- BIntractable problems cannot be solved by any algorithm, while undecidable ones only need exponential time
- CUndecidable problems are in NP, while intractable problems are in P
- DBoth mean the problem has no algorithm at all
8.Hard
Strassen's algorithm multiplies matrices using 7 instead of 8 recursive multiplications of half-size blocks. What is its running time?
- AΘ(nlog₂ 7), about n2.81
- BΘ(n2)
- CΘ(n³)
- DΘ(n² log n)
Answer key
- 1. C · f grows at the same rate as g, bounded above and below by constant multiples of g
- 2. D · The maximum time it takes over all inputs of size n
- 3. C · A finite sequence of well-defined steps that solves a problem
- 4. C · Logarithms with different bases differ only by a constant factor
- 5. A · Makes the locally best choice at each step
- 6. A · O(n²)
- 7. A · An undecidable problem has no algorithm for all inputs; an intractable one has one, but it is too slow
- 8. A · Θ(nlog₂ 7), about n2.81
Full step-by-step solutions: practise this topic on examproblems.com.