Solveeit Logo

Question

Algorithms Question on Algorithm design techniques

Let us consider for an Algorithm A, a nested loop and also a single loop is present what would be the time complexity for algorithm A ?

A

1

B

n

C

n2

D

n3

Answer

n2

Explanation

Solution

The correct option is(C): n2