1.Easy
What is the best-case time complexity of insertion sort, on an already sorted array?
- AO(n)
- BO(1)
- CO(n log n)
- DO(n²)
2.Easy
A problem is usually called tractable if:
- AIt can only be solved by trying every possibility
- BIt can be solved in constant time
- CIt has no solution
- DIt can be solved in polynomial time
3.Easy
Which notation describes a lower bound on growth?
- Ao (little o)
- BΩ (Big Omega)
- CO (Big O)
- DΘ (Big Theta)
4.Medium
What is the time complexity of computing the n-th Fibonacci number with a bottom-up table?
- AO(log n)
- BO(n²)
- CO(n)
- DO(2ⁿ)
5.Medium
What is the time complexity of multiplying two n × n matrices with the standard triple loop?
- AO(n)
- BO(n³)
- CO(n²)
- DO(n² log n)
6.Medium
What is the worst-case time complexity of quicksort?
- AO(n log n)
- BO(n²)
- CO(n)
- DO(log n)
7.Hard
Why can Dijkstra's algorithm give wrong results when some edge weights are negative?
- AA vertex is finalised when extracted, but a later negative edge could still give it a shorter path
- BIt only works on undirected graphs
- CIt goes into an infinite loop on every negative edge
- DNegative numbers cannot be stored in a priority queue
8.Hard
Which statement about P and NP is correct?
- ANP problems cannot be verified quickly
- BIt has been proven that P ≠ NP
- CNP means "not polynomial"
- DEvery problem in P is also in NP
Answer key
- 1. A · O(n)
- 2. D · It can be solved in polynomial time
- 3. B · Ω (Big Omega)
- 4. C · O(n)
- 5. B · O(n³)
- 6. B · O(n²)
- 7. A · A vertex is finalised when extracted, but a later negative edge could still give it a shorter path
- 8. D · Every problem in P is also in NP
Full step-by-step solutions: practise this topic on examproblems.com.