Discussions
Select Date
Tags:
Deepak

· started a discussion

· 1 Months ago

Deepak

· started a discussion

· 1 Months ago

Code is not here

Question:

What is the time complexity of the above code?

Options:
A)

O(logn)

B)

O(n)

C)

O(1)

D)

O(nlogn)

Solution:

Ans: (b)

All the characters in the string have to be processed, hence the complexity is O(n).

All Rights Reserved Top Rankers