Nested Iteration - AP Computer Science A

Card 1 of 30

0
Didn't Know
Knew It
0
1 of 3029 left
Question

What is the time complexity of three nested loops, each iterating over $n$ elements?

Tap to reveal answer

Answer

$O(n^3)$. Three nested loops create cubic complexity: $n \times n \times n = n^3$.

← Didn't Know|Knew It →