1.Easy
What is log₂ 1024?
- A10
- B32
- C12
- D512
2.Easy
Which of these grows slowest as n becomes large?
- AO(n log n)
- BO(n²)
- CO(n)
- DO(log n)
3.Easy
How much extra memory does a standard array-based merge sort use?
- AO(log n)
- BO(n)
- CO(n²)
- DO(1)
4.Medium
A recurrence T(n) = 2T(n/2) + O(n) solves to:
- AO(log n)
- BO(n log n)
- CO(n²)
- DO(n)
5.Medium
In a sorted array, you look for two elements that sum to a target by moving one pointer from each end inwards. What is the time complexity?
- AO(n log n)
- BO(log n)
- CO(n²)
- DO(n)
6.Medium
The time complexity of naive recursive Fibonacci (fib(n) = fib(n−1) + fib(n−2)) is:
- ALinear
- BLogarithmic
- CExponential
- DConstant
7.Hard
Why does binary search not give O(log n) time on a singly linked list?
- AComparisons on linked list nodes are slower
- BLinked lists cannot be sorted
- CBinary search needs at least twice the memory
- DReaching the middle element takes O(n) steps, since there is no direct index access
8.Hard
Why is the average lookup in a hash table O(1) but the worst case O(n)?
- AHash functions are slow
- BKeys must be sorted first
- CMany keys may collide into the same bucket
- DArrays have O(n) access
Answer key
- 1. A · 10
- 2. D · O(log n)
- 3. B · O(n)
- 4. B · O(n log n)
- 5. D · O(n)
- 6. C · Exponential
- 7. D · Reaching the middle element takes O(n) steps, since there is no direct index access
- 8. C · Many keys may collide into the same bucket
Full step-by-step solutions: practise this topic on examproblems.com.