1.Easy
Which of these grows slowest as n becomes large?
- AO(n log n)
- BO(log n)
- CO(n)
- DO(n²)
2.Easy
What does f(n) = Θ(g(n)) mean?
- Af is always smaller than g for every n, so g bounds it from above but never from below
- Bf grows strictly faster than g
- Cf grows strictly slower than g
- Df grows at the same rate as g, bounded above and below by constant multiples of g
3.Easy
Which complexity class grows fastest for large n?
- AO(n³)
- BO(n²)
- CO(2ⁿ)
- DO(n log n)
4.Medium
Breadth-first search on an unweighted graph finds:
- AThe minimum spanning tree
- BA topological order in all graphs
- CShortest paths in graphs that contain negative edge weights
- DShortest paths in number of edges from the start node
5.Medium
The lower bound for comparison-based sorting in the worst case is:
- AΩ(log n)
- BΩ(n log n)
- CΩ(n)
- DΩ(n²)
6.Medium
What does the recurrence T(n) = T(n/2) + O(1) solve to?
- AO(n log n)
- BO(1)
- CO(n)
- DO(log n)
7.Hard
The halting problem shows that:
- ALoops should be avoided
- BEvery program eventually halts
- CNo algorithm can decide for every program and input whether it halts
- DSome programs run faster on faster computers, so halting depends on hardware
8.Hard
Shortest simple paths can be found in polynomial time. What is known about finding the longest simple path between two vertices in a general graph?
- AIt can be solved by Dijkstra's algorithm with negated weights
- BIt is undecidable
- CIt is always solvable in O(V + E)
- DIt is NP-hard
Answer key
- 1. B · O(log n)
- 2. D · f grows at the same rate as g, bounded above and below by constant multiples of g
- 3. C · O(2ⁿ)
- 4. D · Shortest paths in number of edges from the start node
- 5. B · Ω(n log n)
- 6. D · O(log n)
- 7. C · No algorithm can decide for every program and input whether it halts
- 8. D · It is NP-hard
Full step-by-step solutions: practise this topic on examproblems.com.