1.Easy
How much extra memory does a standard array-based merge sort use?
- AO(1)
- BO(log n)
- CO(n²)
- DO(n)
2.Easy
What is the time complexity of depth-first search on a graph stored as adjacency lists?
- AO(E log V)
- BO(V + E)
- CO(V²)
- DO(V × E)
3.Easy
What is the time complexity of binary search on a sorted array?
- AO(log n)
- BO(n)
- CO(n log n)
- DO(1)
4.Medium
Why does dynamic programming give no real speed-up for merge sort?
- AIts subproblems do not overlap, so there is nothing to reuse
- BMerge sort has no recursive structure
- CDynamic programming only works on graph problems, not on arrays
- DMerge sort is already O(n)
5.Medium
What is the running time of LSD radix sort on n integers with d digits in base k?
- AO(n log n)
- BO(dn log k)
- CO(n²)
- DO(d(n + k))
6.Medium
Which algorithm finds the shortest paths from one source in a graph with non-negative edge weights?
- ABellman–Ford is required in all cases
- BDepth-first search
- CDijkstra's algorithm
- DKruskal's algorithm
7.Hard
Strassen's algorithm multiplies matrices using 7 instead of 8 recursive multiplications of half-size blocks. What is its running time?
- AΘ(n2)
- BΘ(nlog₂ 7), about n2.81
- CΘ(n² log n)
- DΘ(n³)
8.Hard
Which definition of the class P is correct?
- ADecision problems solvable by a deterministic algorithm in polynomial time
- BProblems that can be solved in parallel
- CProblems that need exponential time on every computer
- DProblems whose solutions can be checked but never found in polynomial time
Answer key
- 1. D · O(n)
- 2. B · O(V + E)
- 3. A · O(log n)
- 4. A · Its subproblems do not overlap, so there is nothing to reuse
- 5. D · O(d(n + k))
- 6. C · Dijkstra's algorithm
- 7. B · Θ(nlog₂ 7), about n2.81
- 8. A · Decision problems solvable by a deterministic algorithm in polynomial time
Full step-by-step solutions: practise this topic on examproblems.com.