Kizspy | Question: 18
(Choose 1 answer)
(See picture)
A. (i)
B. (ii)
C. (iii)
D. (iv)
Give a big-O estimate for the number of operations (where an operation is an addition or a multiplication) used in this segment of an algorithm.
k := 0
for i:=1 ton* n
for j := 0 to i - 1 k := k + i* j
end
end
(i) 0(n)
(ii) O(nlogn)
(iii) O(n²)
(iv) O(n4)