What is the time complexity for this nested for loop?

Viewed 21

What would be the time complexity for the code below? My guess is O(n log(n)) or O(n log(log(n))), but really not sure. Would appreciate any help!

for (int i = 1; i < n; ++i) {
     for (int j = 1; j < log (n); j *= 2) {
          cout << '-';
     }
}
0 Answers
Related