1.Easy
Which design strategy does merge sort use?
- ABrute force
- BDynamic programming
- CDivide and conquer
- DGreedy choice
2.Easy
What is the time complexity of depth-first search on a graph stored as adjacency lists?
- AO(V + E)
- BO(V²)
- CO(E log V)
- DO(V × E)
3.Easy
Which notation describes a lower bound on growth?
- AΩ (Big Omega)
- BO (Big O)
- CΘ (Big Theta)
- Do (little o)
4.Medium
Quicksort always uses the first element as pivot. On which input does it show its worst-case behaviour?
- AAn array whose elements are all different
- BAn array of length 2
- CAn array in random order
- DAn array that is already sorted
5.Medium
Breadth-first search on an unweighted graph finds:
- AShortest paths in graphs that contain negative edge weights
- BThe minimum spanning tree
- CShortest paths in number of edges from the start node
- DA topological order in all graphs
6.Medium
The time complexity of naive recursive Fibonacci (fib(n) = fib(n−1) + fib(n−2)) is:
- AExponential
- BLogarithmic
- CLinear
- DConstant
7.Hard
How is the travelling salesman problem classified?
- AThe decision version is in P but the optimisation version is NP-complete
- BIt is in P because Dijkstra's algorithm solves it by visiting every city once
- CIt is undecidable
- DThe decision version is NP-complete and the optimisation version is NP-hard
8.Hard
Using the master theorem, T(n) = 8T(n/2) + O(n²) solves to:
- AΘ(n log n)
- BΘ(n²)
- CΘ(n² log n)
- DΘ(n³)
Answer key
- 1. C · Divide and conquer
- 2. A · O(V + E)
- 3. A · Ω (Big Omega)
- 4. D · An array that is already sorted
- 5. C · Shortest paths in number of edges from the start node
- 6. A · Exponential
- 7. D · The decision version is NP-complete and the optimisation version is NP-hard
- 8. D · Θ(n³)
Full step-by-step solutions: practise this topic on examproblems.com.