1.Easy
A problem is usually called tractable if:
- AIt can be solved in polynomial time
- BIt can only be solved by trying every possibility
- CIt has no solution
- DIt can be solved in constant time
2.Easy
What does it mean if an operation runs in O(1) time?
- AIt can only be run once
- BIt processes exactly one element per second of running time
- CIt always takes exactly one second
- DIts running time does not grow with the input size
3.Easy
An algorithm with two nested loops, each running n times, typically has which complexity?
- AO(log n)
- BO(n)
- CO(n²)
- DO(2n)
4.Medium
Is it correct to say that an O(n²) algorithm is also O(n³)?
- AYes, but only if n is smaller than 100
- BYes, because Big O is an upper bound and n² grows no faster than n³
- CNo, because n³ is smaller than n² for large n
- DNo, because Big O must always state the exact growth rate of the function
5.Medium
In the activity selection problem, which greedy rule always gives a maximum number of non-overlapping activities?
- APick the activity with the fewest overlaps first, then repeat with the compatible ones
- BPick the activity that finishes earliest, then repeat with the compatible ones
- CPick the activity that starts earliest
- DPick the shortest activity first
6.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)
- BO(n²)
- CO(log n)
- DO(n log n)
7.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(n²)
- CO(log n)
- DO(n)
8.Hard
The Held–Karp dynamic programming algorithm solves the travelling salesman problem exactly. What is its running time for n cities?
- AO(n³)
- BO(n!)
- CO(n² 2ⁿ)
- DO(2n²)
Answer key
- 1. A · It can be solved in polynomial time
- 2. D · Its running time does not grow with the input size
- 3. C · O(n²)
- 4. B · Yes, because Big O is an upper bound and n² grows no faster than n³
- 5. B · Pick the activity that finishes earliest, then repeat with the compatible ones
- 6. A · O(n)
- 7. D · O(n)
- 8. C · O(n² 2ⁿ)
Full step-by-step solutions: practise this topic on examproblems.com.