Question DSA-CX-0043
MediumWhat is the time complexity of this code?
def f(n):
if n <= 1:
return
f(n // 2)
f(n // 2)
for i in range(n):
work()
- A.
O(n log n)
- B.
O(n)
- C.
Sign up free to see the answer and a step-by-step explanation.