Hey guys, i'm have a tough time working the following two problems. I need to find out the theta notation or big O for the number of times x=x+1 is executed
i = 1
while (i < n) {
i = i^2;
x = x + 1;
}
I tried to work this thing out and got Theta(2^n!). I doubt that this is right though
Here is the 2nd problem
for i = 1 to n
for j = 1 to i
for k = 1 to j
x = x + 1
I'm thinking that this one is Theta(n^3), but again i'm not so sure. Any help is greatly appreciated.