logo

Crowdly

Browser

Add to Chrome

Qual a complexidade temporal no pior caso do método fatorial? // What is the w...

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

Qual a complexidade temporal no pior caso do método fatorial? //

What is the worst-case time complexity of the method fatorial?

public static long fatorial(int n) {

if (n < 0)

throw new IllegalArgumentException();

if (n == 0 || n == 1)

return 1;

else

return n * fatorial(n - 1);

}

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

Want instant access to all verified answers on moodle.fct.unl.pt?

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

Browser

Add to Chrome