1.Easy
What is log₂ 1024?
- A10
- B32
- C512
- D12
2.Easy
How does selection sort work?
- AIt splits the array in halves and merges them
- BIt repeatedly finds the minimum of the unsorted part and swaps it to the front
- CIt repeatedly swaps neighbouring elements that are in the wrong order
- DIt inserts each element into a growing sorted part by shifting
3.Easy
What is the time complexity of linear search in an unsorted array of n elements (worst case)?
- AO(1)
- BO(log n)
- CO(n²)
- DO(n)
4.Medium
What is the time complexity of multiplying two n × n matrices with the standard triple loop?
- AO(n²)
- BO(n)
- CO(n² log n)
- DO(n³)
5.Medium
What is the time complexity of: for i = 1 to n: for j = 1 to i: do O(1) work?
- AO(n³)
- BO(n log n)
- CO(n)
- DO(n²)
6.Medium
What is the time complexity of: for i = 1 to n: (j = 1; while j < n: j = j × 2)?
- AO(n)
- BO(log n)
- CO(n log n)
- DO(n²)
7.Hard
The halting problem shows that:
- AEvery program eventually halts
- BSome programs run faster on faster computers, so halting depends on hardware
- CNo algorithm can decide for every program and input whether it halts
- DLoops should be avoided
8.Hard
What is the running time of Dijkstra's algorithm with a binary heap on a graph with V vertices and E edges?
- AO(V + E)
- BO(V × E)
- CO((V + E) log V)
- DO(V³)
Answer key
- 1. A · 10
- 2. B · It repeatedly finds the minimum of the unsorted part and swaps it to the front
- 3. D · O(n)
- 4. D · O(n³)
- 5. D · O(n²)
- 6. C · O(n log n)
- 7. C · No algorithm can decide for every program and input whether it halts
- 8. C · O((V + E) log V)
Full step-by-step solutions: practise this topic on examproblems.com.