Skip to content

Instantly share code, notes, and snippets.

@bhaveshmunot1
Created June 4, 2020 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhaveshmunot1/9c06e575713726fc63ec5477a72e4473 to your computer and use it in GitHub Desktop.
Save bhaveshmunot1/9c06e575713726fc63ec5477a72e4473 to your computer and use it in GitHub Desktop.
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