1.Easy
What is the time complexity of linear search in an unsorted array of n elements (worst case)?
- AO(log n)
- BO(n²)
- CO(n)
- DO(1)
2.Easy
What is log₂ 1024?
- A32
- B10
- C12
- D512
3.Easy
What is O(2ⁿ) growth called?
- ALogarithmic
- BPolynomial
- CExponential
- DLinear
4.Medium
What is the running time of LSD radix sort on n integers with d digits in base k?
- AO(d(n + k))
- BO(n²)
- CO(n log n)
- DO(dn log k)
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(n²)
- CO(n)
- DO(log n)
6.Medium
Dynamic programming is useful when a problem has:
- AOverlapping subproblems and optimal substructure
- BOnly random inputs
- CA single loop
- DNo subproblems at all, so it can be solved in one step
7.Hard
Why does any comparison-based search in a sorted array need Ω(log n) comparisons in the worst case?
- AA decision tree with n possible outcomes must have depth at least log₂ n
- BBinary search is the only possible algorithm, and it needs log₂ n comparisons
- CEvery element must be compared at least once
- DComparisons take logarithmic time each
8.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
Answer key
- 1. C · O(n)
- 2. B · 10
- 3. C · Exponential
- 4. A · O(d(n + k))
- 5. C · O(n)
- 6. A · Overlapping subproblems and optimal substructure
- 7. A · A decision tree with n possible outcomes must have depth at least log₂ n
- 8. A · An undecidable problem has no algorithm for all inputs; an intractable one has one, but it is too slow
Full step-by-step solutions: practise this topic on examproblems.com.