1.Easy
What is recursion?
- AA sorting method
- BA loop that never ends
- CA type of data structure
- DA function that calls itself on smaller inputs
2.Easy
What is the time complexity of depth-first search on a graph stored as adjacency lists?
- AO(V + E)
- BO(E log V)
- CO(V²)
- DO(V × E)
3.Easy
Which design strategy does merge sort use?
- ABrute force
- BDivide and conquer
- CDynamic programming
- DGreedy choice
4.Medium
What does the recurrence T(n) = T(n − 1) + O(1) solve to?
- AO(n²)
- BO(log n)
- CO(2ⁿ)
- DO(n)
5.Medium
How many levels does the recursion of merge sort have for an array of n elements?
- AAbout √n
- BAbout n / 2
- CAbout log₂ n
- DAbout n
6.Medium
What does the recurrence T(n) = 2T(n/2) + O(1) solve to?
- AO(n)
- BO(n log n)
- CO(n²)
- DO(log n)
7.Hard
Why does binary search not give O(log n) time on a singly linked list?
- ALinked lists cannot be sorted
- BComparisons on linked list nodes are slower
- CBinary search needs at least twice the memory
- DReaching the middle element takes O(n) steps, since there is no direct index access
8.Hard
What are the time and space costs of computing the n-th Fibonacci number with a loop that keeps only the last two values?
- AO(log n) time and O(n) space
- BO(n) time and O(n) space
- CO(n) time and O(1) space
- DO(2ⁿ) time and O(1) space
Answer key
- 1. D · A function that calls itself on smaller inputs
- 2. A · O(V + E)
- 3. B · Divide and conquer
- 4. D · O(n)
- 5. C · About log₂ n
- 6. A · O(n)
- 7. D · Reaching the middle element takes O(n) steps, since there is no direct index access
- 8. C · O(n) time and O(1) space
Full step-by-step solutions: practise this topic on examproblems.com.