Question
Computer Science Question on Data Structures
A loop within a loop (nested loop) have time complexity ______.
A
n
B
n2
C
n+1
D
n3
Answer
n2
Explanation
Solution
The correct option is (B) :n2.
A loop within a loop (nested loop) have time complexity ______.
n
n2
n+1
n3
n2
The correct option is (B) :n2.