1.Easy
Which design strategy does merge sort use?
- ABrute force
- BDivide and conquer
- CDynamic programming
- DGreedy choice
2.Easy
Which notation describes an upper bound on growth?
- ABig O
- BBig Omega
- CBig Theta
- DLittle omega
3.Easy
Which sorting algorithm repeatedly swaps adjacent elements that are in the wrong order?
- AHeap sort
- BBubble sort
- CQuicksort
- DMerge sort
4.Medium
About how many comparisons does binary search need in the worst case on a sorted array of 1,000,000 elements?
- AAbout 500,000
- BAbout 20
- CAbout 1,000
- DAbout 100
5.Medium
What does the recurrence T(n) = T(n − 1) + O(1) solve to?
- AO(n)
- BO(n²)
- CO(log n)
- DO(2ⁿ)
6.Medium
What does it mean that a problem has optimal substructure?
- AAn optimal solution can be built from optimal solutions of its subproblems
- BEvery subproblem has the same size
- CThe problem can be solved in constant time
- DThe problem has exactly one optimal solution, which every subproblem shares
7.Hard
Which statement about little-o notation is correct?
- An² = o(n)
- Bn = o(n²), but n is not o(n)
- C2n = o(n), because 2n grows slowly
- Dn = o(n), since every function is little-o of itself
8.Hard
Is 22n in O(2ⁿ)?
- AYes, because both are exponential
- BNo, because 22n grows more slowly than 2ⁿ
- CNo, because 22n = 4ⁿ and 4ⁿ / 2ⁿ = 2ⁿ grows without bound
- DYes, because constant factors in the exponent are always ignored in Big O
Answer key
- 1. B · Divide and conquer
- 2. A · Big O
- 3. B · Bubble sort
- 4. B · About 20
- 5. A · O(n)
- 6. A · An optimal solution can be built from optimal solutions of its subproblems
- 7. B · n = o(n²), but n is not o(n)
- 8. C · No, because 22n = 4ⁿ and 4ⁿ / 2ⁿ = 2ⁿ grows without bound
Full step-by-step solutions: practise this topic on examproblems.com.