1.Easy
What is the time complexity of finding the largest value in an unsorted array of n numbers?
- AO(n)
- BO(1)
- CO(n log n)
- DO(log n)
2.Easy
Which of these running times is polynomial?
- AO(2ⁿ)
- BO(n!)
- CO(nⁿ)
- DO(n³)
3.Easy
Which notation describes a lower bound on growth?
- AΘ (Big Theta)
- Bo (little o)
- CΩ (Big Omega)
- DO (Big O)
4.Medium
The lower bound for comparison-based sorting in the worst case is:
- AΩ(log n)
- BΩ(n)
- CΩ(n²)
- DΩ(n log n)
5.Medium
What does the recurrence T(n) = T(n − 1) + O(n) solve to?
- AO(n²)
- BO(n log n)
- CO(n)
- DO(2ⁿ)
6.Medium
What is the time complexity of the Bellman–Ford algorithm on a graph with V vertices and E edges?
- AO(V + E)
- BO(V³ × E)
- CO(E log V)
- DO(V × E)
7.Hard
How does the Bellman–Ford algorithm detect a negative-weight cycle reachable from the source?
- AAfter V − 1 rounds, it checks whether any edge can still be relaxed
- BIt counts the cycles with depth-first search
- CIt runs Dijkstra's algorithm twice and compares the two distance results
- DIt checks whether any edge has a negative weight
8.Hard
Which definition of the class P is correct?
- AProblems whose solutions can be checked but never found in polynomial time
- BDecision problems solvable by a deterministic algorithm in polynomial time
- CProblems that can be solved in parallel
- DProblems that need exponential time on every computer
Answer key
- 1. A · O(n)
- 2. D · O(n³)
- 3. C · Ω (Big Omega)
- 4. D · Ω(n log n)
- 5. A · O(n²)
- 6. D · O(V × E)
- 7. A · After V − 1 rounds, it checks whether any edge can still be relaxed
- 8. B · Decision problems solvable by a deterministic algorithm in polynomial time
Full step-by-step solutions: practise this topic on examproblems.com.