Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.