...
Joka kohdassa haluttu vastaus on O(1), O(n), O(n^2) tai O(n^3).
for i = 1 to 5*n ...
Aikavaativuus:
for i = 1 to n ... for i = 1 to n ... for i = 1 to n ...
for i = 1 to 2*n for j = 1 to n/2 ...
for i = 1 to n*n ...
for i = 1 to 100 for j = 1 to n ...
a = 1 b = n while a < b a++ b--
j = 1 for i = 1 to n while j < 10*i j++
a = 1 while a < n a = n
The deadline for this task has passed but you can still check your answers