1.Easy
What is the worst-case time complexity of merge sort?
- AO(log n)
- BO(n log n)
- CO(n)
- DO(n²)
2.Easy
What is memoisation?
- AWriting comments next to each line of code
- BConverting recursion into an equivalent loop automatically so no call stack is needed
- CFreeing memory after a function returns
- DStoring the results of function calls so repeated calls are answered from memory
3.Easy
How much extra memory does a standard array-based merge sort use?
- AO(n²)
- BO(1)
- CO(log n)
- DO(n)
4.Medium
Which sorting algorithm is stable?
- AMerge sort
- BQuicksort (typical in-place version)
- CHeap sort
- DSelection sort (typical version)
5.Medium
The lower bound for comparison-based sorting in the worst case is:
- AΩ(n log n)
- BΩ(log n)
- CΩ(n)
- DΩ(n²)
6.Medium
What does the recurrence T(n) = 2T(n/2) + O(1) solve to?
- AO(n²)
- BO(log n)
- CO(n log n)
- DO(n)
7.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Θ(nlog₂ 7), about n2.81
- DΘ(n² log n)
8.Hard
Which bound is correct for log(n!)?
- AΘ(n log n)
- BΘ(n²)
- CΘ(n)
- DΘ(log n)
Answer key
- 1. B · O(n log n)
- 2. D · Storing the results of function calls so repeated calls are answered from memory
- 3. D · O(n)
- 4. A · Merge sort
- 5. A · Ω(n log n)
- 6. D · O(n)
- 7. C · Θ(nlog₂ 7), about n2.81
- 8. A · Θ(n log n)
Full step-by-step solutions: practise this topic on examproblems.com.