How to determine a Big-O estimate for an algorithm

470 Views Asked by At

This question has been mentioned in the forum but with a different approach. I need to determine a Big-O estimate for the number of operations of the algorithm below taking into account only additions and multiplications. I have already taken the time to analyzed it and I see that the number of iterations depends on the value of $i$ which doubles at each loop $i = 2^n$. My question is how to determine the function that will provide the number of operations and finally will be used to get the Big-O estimate?

$$ i = 1;\\ t = 0;\\ \text{while} \quad (i <= n) \quad \{t = t + i; i = 2 * i;\} $$