Given:

```
for (int i = 1; i <= n;  i *= 2) {
  for (int j = 0; j < i; j++) {
    // Statement(s) that take(s) constant time
  }
}

```

Running Time Complexity = `O(n)`

Explanation was:
[![enter image description here](https://i.stack.imgur.com/AWBj6.png)](https://i.stack.imgur.com/AWBj6.png)

I understand that the outer loop is `log(n)` and the inner loop is `O(n)`.
But why time complexity is not `O(n log n)`? why it's `O(n + log n)`?