logo

Crowdly

What is the time complexity of the following function if measured with respect t...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What is the time complexity of the following function if measured with respect to n?

def mystery(n: int) -> None:

if n <= 0:

return

else:

if n % 2 == 0:

mystery(n - 1)

else:

mystery(n // 2)

0%
0%
100%
0%
More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!