A loop starts with i = 1 and doubles i each iteration until i > n. How many iterations does it run?
- AAbout n²
- BAbout n
- CAbout log₂ n
- DAbout n / 2
A loop starts with i = 1 and doubles i each iteration until i > n. How many iterations does it run?
Which notation describes a lower bound on growth?
Which of these grows slowest as n becomes large?
What does the recurrence T(n) = T(n/2) + O(1) solve to?
What does the recurrence T(n) = T(n − 1) + O(1) solve to?
A recurrence T(n) = 2T(n/2) + O(n) solves to:
Shortest simple paths can be found in polynomial time. What is known about finding the longest simple path between two vertices in a general graph?
Strassen's algorithm multiplies matrices using 7 instead of 8 recursive multiplications of half-size blocks. What is its running time?
Full step-by-step solutions: practise this topic on examproblems.com.