Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factorial #1351

Closed
wants to merge 2 commits into from
Closed

Factorial #1351

wants to merge 2 commits into from

Conversation

Aditya-Ghosh-27
Copy link

@Aditya-Ghosh-27 Aditya-Ghosh-27 commented Oct 14, 2023

Title:
Factorial program in C using recursion

Solved #1326

Description:
This program implements a function named factorial which computes the factorial of a number with a O(n) time complexity.

Why is this PR needed?
The other solutions does the job but they are not using recursion as clearly mentioned in the issues. My solution uses recursion and thus is maintaining the criteria of the issue.

My solution:
int factorial(int n) { if(n == 0) return 1; else return n * factorial(n-1); }

Copy link
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 14, 2023
Copy link
Contributor

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions bot closed this Nov 21, 2023
@Aditya-Ghosh-27 Aditya-Ghosh-27 deleted the factorial branch January 20, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant