1.Easy
A problem is usually called tractable if:
- AIt can be solved in polynomial time
- BIt can only be solved by trying every possibility
- CIt can be solved in constant time
- DIt has no solution
2.Easy
What is log₂ 1024?
- A512
- B32
- C12
- D10
3.Easy
Which complexity class grows fastest for large n?
- AO(n²)
- BO(2ⁿ)
- CO(n³)
- DO(n log n)
4.Medium
Why is the base of a logarithm usually left out in Big O, as in O(log n)?
- ALogarithms are always rounded to integers
- BThe base only matters for small n
- CAll logarithms in computer science have base 10, so it is implied
- DLogarithms with different bases differ only by a constant factor
5.Medium
What is the running time of LSD radix sort on n integers with d digits in base k?
- AO(d(n + k))
- BO(n log n)
- CO(n²)
- DO(dn log k)
6.Medium
Which algorithm finds the shortest paths from one source in a graph with non-negative edge weights?
- AKruskal's algorithm
- BDepth-first search
- CDijkstra's algorithm
- DBellman–Ford is required in all cases
7.Hard
What is the time complexity of building a binary heap from n unsorted elements with the bottom-up method?
- AO(log n)
- BO(n log n)
- CO(n)
- DO(n²)
8.Hard
A problem is NP-complete if it is:
- AImpossible to solve
- BSolvable in polynomial time
- CIn NP and every NP problem reduces to it in polynomial time
- DOutside NP but harder than all NP problems, such as the halting problem
Answer key
- 1. A · It can be solved in polynomial time
- 2. D · 10
- 3. B · O(2ⁿ)
- 4. D · Logarithms with different bases differ only by a constant factor
- 5. A · O(d(n + k))
- 6. C · Dijkstra's algorithm
- 7. C · O(n)
- 8. C · In NP and every NP problem reduces to it in polynomial time
Full step-by-step solutions: practise this topic on examproblems.com.