1.Easy
What is the time complexity of linear search in an unsorted array of n elements (worst case)?
- AO(n²)
- BO(n)
- CO(1)
- DO(log n)
2.Easy
What is a brute-force algorithm?
- AOne that runs on many processors
- BOne that always uses recursion
- COne that tries all possible candidate solutions
- DOne that guesses an answer at random
3.Easy
Which notation describes an upper bound on growth?
- ABig Theta
- BBig O
- CLittle omega
- DBig Omega
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
Is it correct to say that an O(n²) algorithm is also O(n³)?
- AYes, but only if n is smaller than 100
- BNo, because n³ is smaller than n² for large n
- CYes, because Big O is an upper bound and n² grows no faster than n³
- DNo, because Big O must always state the exact growth rate of the function
6.Medium
What is the amortised time complexity of appending to a dynamic array that doubles its capacity when full?
- AO(1)
- BO(log n)
- CO(n)
- DO(n²)
7.Hard
Which two things must be shown to prove that a decision problem X is NP-complete?
- AX is in P, and X reduces to SAT
- BX reduces to a problem in P, and X is in NP
- CX is in NP, and a known NP-complete problem reduces to X in polynomial time
- DX has no polynomial algorithm, and X is decidable
8.Hard
What is the time complexity of building a binary heap from n unsorted elements with the bottom-up method?
- AO(n log n)
- BO(log n)
- CO(n²)
- DO(n)
Answer key
- 1. B · O(n)
- 2. C · One that tries all possible candidate solutions
- 3. B · Big O
- 4. B · O(n log n)
- 5. C · Yes, because Big O is an upper bound and n² grows no faster than n³
- 6. A · O(1)
- 7. C · X is in NP, and a known NP-complete problem reduces to X in polynomial time
- 8. D · O(n)
Full step-by-step solutions: practise this topic on examproblems.com.