I'm studying for an exam and have run into this problem:
j=n
while (j>=1) {
for i=1 to j
x= x+1;
j=j/2
}
The question is to derive theta notation for the number of times that x = x+1 is executed. To me this looks likes an nlog(n). Not sure if this is true or not. What techniques are recommended for analyzing this algorithm more mathematically? I mean like a step by step solution.
Any help would be greatly appreciated.