Give big-O estimate for the number of operations (multiplication or addition) used in the following algorithm segment (ignore comparisons to check while conditions).
i =1
t = 0
while i <= n
i = t+i
t = 2i
i =1
t = 0
while i <= n
i = t+i
t = 2i