I have to determine the runtime complexity of the following algorithm (see picture). I know how to do so theoretically, but for this specific example I'm having a hard time and also have no sample solution to see if I'm corrrect.
If someone could review my answer and correct it and maybe even give a explanation of the correct solution, that would be greatly appreciated.
Overall --> Θ(n^2)
for(int i=42; i<n*Math.log(n); i++)Θ(n)
foo(i); Θ(n*log2(n))
for(int j=1; j<4711; j=j*3) Θ(n)
bar(i*j); Θ(log2(n))
foo(int n) --> Θ(n*log2(n))
if(n%2 == 0) Θ(1)
for(int i=1; i<2*n; i=i+2) Θ(n)
bar(i); Θ(log2(n))
else --> Θ(n*log2(n))
for(int i=1; i<n; i++) Θ(n)
bar(n); Θ(log2(n))
bar(int m) --> Θ(log2(n))
while(m>0) Θ(log2(n))
m = m/4; Θ(1)