✅ 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); }