Question DSA-CX-0045
MediumWhat is the time complexity of this code?
i = 2
while i < n:
i = i * i
- A.
O(log n)
- B.
O(log log n)
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Complexity Analysis question
What is the time complexity of this code?
i = 2
while i < n:
i = i * i
O(log n)
O(log log n)
Sign up free to see the answer and a step-by-step explanation.
O(n)
O(√n)