1.Easy
Which complexity class grows fastest for large n?
- AO(2ⁿ)
- BO(n³)
- CO(n log n)
- DO(n²)
2.Easy
What is the worst-case time complexity of insertion sort?
- AO(n)
- BO(log n)
- CO(n log n)
- DO(n²)
3.Easy
What is the running time of counting sort for n integers in the range 0 to k?
- AO(n²)
- BO(n + k)
- CO(k log n)
- DO(n log n)
4.Medium
With coins of 1, 3 and 4 and an amount of 6, how many coins does the greedy "largest coin first" method use, compared to the optimum?
- AGreedy uses 4 coins; the optimum is 3
- BGreedy uses 2 coins; the optimum is 2
- CGreedy uses 3 coins; the optimum is 3
- DGreedy uses 3 coins; the optimum is 2
5.Medium
Which algorithm finds the shortest paths from one source in a graph with non-negative edge weights?
- ADepth-first search
- BKruskal's algorithm
- CDijkstra's algorithm
- DBellman–Ford is required in all cases
6.Medium
Why does dynamic programming give no real speed-up for merge sort?
- ADynamic programming only works on graph problems, not on arrays
- BMerge sort has no recursive structure
- CIts subproblems do not overlap, so there is nothing to reuse
- DMerge sort is already O(n)
7.Hard
What is the running time of Dijkstra's algorithm with a binary heap on a graph with V vertices and E edges?
- AO(V³)
- BO(V + E)
- CO((V + E) log V)
- DO(V × E)
8.Hard
Which algorithm finds a minimum spanning tree by repeatedly adding the cheapest edge that does not form a cycle?
- AKruskal's algorithm
- BPrim's algorithm starting from one node
- CFloyd–Warshall
- DDijkstra's algorithm
Answer key
- 1. A · O(2ⁿ)
- 2. D · O(n²)
- 3. B · O(n + k)
- 4. D · Greedy uses 3 coins; the optimum is 2
- 5. C · Dijkstra's algorithm
- 6. C · Its subproblems do not overlap, so there is nothing to reuse
- 7. C · O((V + E) log V)
- 8. A · Kruskal's algorithm
Full step-by-step solutions: practise this topic on examproblems.com.