Here's the question that Sam asked about. The quiz allowed one of two possible answers, but only one is really correct.

```
int count = 0;
for (int i = 0; i < n; i++){
for (int j = 0; j < 100000; j++){
count++;
}
}
count++;
count++;
```

0 votes

The ONE correct answer is O(n). Because the inner loop executes a constant number of times, its execution is not dependent on the value of n. Therefore, the answer is O(n) because of the outer loop. Now in Moodle, the only correct answer accepted is O(n).

As far as your score, if you answered O(n^2), I'm not reducing your score, but you should understand why O(n^2) is not correct.