single for-loop runtime explanation problem
- by owwyess
I am analyzing some running times of different for-loops, and as I'm getting more knowledge, I'm curious to understand this problem which I have still yet to find out.
I have this exercise called "How many stars are printed":
for (int i = N; i > 1; i = i/2) System.out.println("*");
The answers to pick from is
A: ~log N
B: ~N
C: ~N log N
D:…