I am working on time complexity. I have read some books, but still I think I can only understand basic staff. I have a 4 stage loop as an example and I am trying to calculate time complexity for it.
for(n=0;n<10000;n++)
for(i=n; i>0; i=i/2)
for(j=1; j<i; j=j*2)
for(k=n;k--;)
So starting from the inner part of the loop I am sure that it will be executed n-1 times
. Also the outer part is also n times..
But can't figure out the other 2 loops complexity and how I will calculate the total. To be more specific, I suspect that they have a logn complexity, but I really think I get it wrong..