1.Easy
What is the best-case time complexity of insertion sort, on an already sorted array?
- AO(n²)
- BO(n)
- CO(1)
- DO(n log n)
2.Easy
What does it mean if an operation runs in O(1) time?
- AIt can only be run once
- BIt processes exactly one element per second of running time
- CIts running time does not grow with the input size
- DIt always takes exactly one second
3.Easy
What is the time complexity of binary search on a sorted array?
- AO(1)
- BO(n log n)
- CO(n)
- DO(log n)
4.Medium
What does the recurrence T(n) = T(n/2) + O(1) solve to?
- AO(1)
- BO(log n)
- CO(n)
- DO(n log n)
5.Medium
What is the time complexity of computing the n-th Fibonacci number with a bottom-up table?
- AO(n²)
- BO(n)
- CO(log n)
- DO(2ⁿ)
6.Medium
A recurrence T(n) = 2T(n/2) + O(n) solves to:
- AO(log n)
- BO(n log n)
- CO(n²)
- DO(n)
7.Hard
Topological sorting is possible only for:
- AUndirected graphs
- BGraphs with negative weights
- CComplete graphs
- DDirected acyclic graphs
8.Hard
Why does binary search not give O(log n) time on a singly linked list?
- ABinary search needs at least twice the memory
- BReaching the middle element takes O(n) steps, since there is no direct index access
- CLinked lists cannot be sorted
- DComparisons on linked list nodes are slower
Answer key
- 1. B · O(n)
- 2. C · Its running time does not grow with the input size
- 3. D · O(log n)
- 4. B · O(log n)
- 5. B · O(n)
- 6. B · O(n log n)
- 7. D · Directed acyclic graphs
- 8. B · 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.