logo

Crowdly

Browser

Add to Chrome

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) -> int:

count = 0

for i in range(n):

count += 1

if n == 0:

return count

else:

return mystery(n - 1)

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!

Browser

Add to Chrome