Professional Documents
Culture Documents
Quiz1 - SuTuTh - 900 - 1 - Answers
Quiz1 - SuTuTh - 900 - 1 - Answers
for (i=1;i<=n;i=i+1)
for (j=n;j>=√𝑛;j=j-1)
c++;
√𝑛 𝑛
∑ ∑ 1 = 𝑛(𝑛 − √𝑛 + 1) = 𝑛2 − 𝑛√𝑛 + 𝑛
𝑖=1 𝑗=√𝑛
Question 2: In each of the following situations, indicate whether f = O(g), or f = Ω(g), or both (in
which case f = Θ(g)). Justify your answers.
𝑛 √𝑛
(b) f(n) = , g(n) = √𝑛 (𝑙𝑜𝑔 𝑛)2
log 𝑛
Good Luck