1.Easy
Which notation describes an upper bound on growth?
- ALittle omega
- BBig Omega
- CBig Theta
- DBig O
2.Easy
What is O(2ⁿ) growth called?
- ALinear
- BPolynomial
- CExponential
- DLogarithmic
3.Easy
What does binary search require of its input?
- AThe array must have no more than 1000 elements
- BThe array length must be a power of two
- CThe array must be sorted
- DThe array must contain only positive numbers
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 3 coins; the optimum is 2
- BGreedy uses 4 coins; the optimum is 3
- CGreedy uses 3 coins; the optimum is 3
- DGreedy uses 2 coins; the optimum is 2
5.Medium
Why do many library sorting routines switch to insertion sort for very small subarrays?
- AInsertion sort has little overhead and is fast on small or nearly sorted inputs
- BInsertion sort uses less memory than any other sorting algorithm on large inputs
- CInsertion sort is O(n log n) in the worst case
- DRecursive algorithms cannot handle arrays below 10 elements
6.Medium
You sort an array of n elements once and then answer k membership queries with binary search. What is the total cost?
- AO(n + k)
- BO(n log n + k log n)
- CO(k n log n)
- DO(nk)
7.Hard
What would follow if someone found a polynomial-time algorithm for one NP-complete problem?
- AOnly that one problem would move into P
- BAll exponential-time algorithms would immediately run in linear time
- CThe halting problem would become decidable
- DEvery problem in NP could be solved in polynomial time, so P = NP
8.Hard
Why can Dijkstra's algorithm give wrong results when some edge weights are negative?
- AIt only works on undirected graphs
- BA vertex is finalised when extracted, but a later negative edge could still give it a shorter path
- CIt goes into an infinite loop on every negative edge
- DNegative numbers cannot be stored in a priority queue
Answer key
- 1. D · Big O
- 2. C · Exponential
- 3. C · The array must be sorted
- 4. A · Greedy uses 3 coins; the optimum is 2
- 5. A · Insertion sort has little overhead and is fast on small or nearly sorted inputs
- 6. B · O(n log n + k log n)
- 7. D · Every problem in NP could be solved in polynomial time, so P = NP
- 8. B · A vertex is finalised when extracted, but a later negative edge could still give it a shorter path
Full step-by-step solutions: practise this topic on examproblems.com.