Find Time Complexity of Recursive Implementation of N!.
int factorial(int n) { // T(n) | |
if (n <= 1) { // 1 | |
return 1; // 1 | |
} | |
int temp = factorial(n-1); // T(n-1) | |
return n*temp; // 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment