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 (ignoring comparisons used to test the conditions in the while or for loop).
a)
t := 0
for i := 1 to n
for j := 1 to m
t := t + i + j
b)
t := 0
for i := 1 to n
t := t · 2
for j := 1 to m
t := t + j
c)
t := 0
i := 1
while i ≤ n
t := t - i
i := i · 3