1.Easy
What does it mean if an operation runs in O(1) time?
- AIt processes exactly one element per second of running time
- BIt can only be run once
- CIts running time does not grow with the input size
- DIt always takes exactly one second
2.Easy
An algorithm's running time is O(n). What is this growth called?
- AConstant
- BLogarithmic
- CLinear
- DQuadratic
3.Easy
How much extra memory does a standard array-based merge sort use?
- AO(n²)
- BO(log n)
- CO(n)
- DO(1)
4.Medium
What does the recurrence T(n) = T(n − 1) + O(1) solve to?
- AO(n)
- BO(log n)
- CO(n²)
- DO(2ⁿ)
5.Medium
What is the time complexity of: for i = 1 to n: (j = 1; while j < n: j = j × 2)?
- AO(log n)
- BO(n)
- CO(n²)
- DO(n log n)
6.Medium
In the activity selection problem, which greedy rule always gives a maximum number of non-overlapping activities?
- APick the activity that starts earliest
- BPick the activity with the fewest overlaps first, then repeat with the compatible ones
- CPick the activity that finishes earliest, then repeat with the compatible ones
- DPick the shortest activity first
7.Hard
What is the difference between an undecidable problem and an intractable one?
- AIntractable problems cannot be solved by any algorithm, while undecidable ones only need exponential time
- BAn undecidable problem has no algorithm for all inputs; an intractable one has one, but it is too slow
- CBoth mean the problem has no algorithm at all
- DUndecidable problems are in NP, while intractable problems are in P
8.Hard
Why does binary search not give O(log n) time on a singly linked list?
- AComparisons on linked list nodes are slower
- BLinked lists cannot be sorted
- CReaching the middle element takes O(n) steps, since there is no direct index access
- DBinary search needs at least twice the memory
Answer key
- 1. C · Its running time does not grow with the input size
- 2. C · Linear
- 3. C · O(n)
- 4. A · O(n)
- 5. D · O(n log n)
- 6. C · Pick the activity that finishes earliest, then repeat with the compatible ones
- 7. B · An undecidable problem has no algorithm for all inputs; an intractable one has one, but it is too slow
- 8. C · Reaching the middle element takes O(n) steps, since there is no direct index access
Full step-by-step solutions: practise this topic on examproblems.com.