How many stars are printed? (Choose the smallest correct estimate.)
for (int i = 0; i < N / 2; i = i + 1) for (int j = 1; j < N / 2; j = 2 * j) StdOut.print("**");
- O(log N)
- O(N)
- O(N log N)
- O(N^2)
I'm kind of stuck with this question and I think it is A or D but im not sure.
I know how the Big O notation work but I'm more confused about the increment in the inner loop when you multiply by 2. The reason for me to think it is A is due to the outer loop being logarithmic(?)but as I said, I'm not so sure with the inner loop. Thank you in advance