Add Factorial algorithm using recursion#6738
Closed
Ayush41 wants to merge 11 commits intoTheAlgorithms:masterfrom
Closed
Add Factorial algorithm using recursion#6738Ayush41 wants to merge 11 commits intoTheAlgorithms:masterfrom
Ayush41 wants to merge 11 commits intoTheAlgorithms:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6738 +/- ##
============================================
- Coverage 77.11% 77.11% -0.01%
+ Complexity 6111 6110 -1
============================================
Files 719 719
Lines 20437 20437
Branches 3952 3952
============================================
- Hits 15761 15760 -1
Misses 4079 4079
- Partials 597 598 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
@Ayush41 already exists in https://github.com/TheAlgorithms/Java/blob/master/src/main/java/com/thealgorithms/maths/FactorialRecursion.java . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds an implementation of the Factorial algorithm using recursion under the
com.thealgorithms.recursionpackage.✅ Summary:
Factorial.javato demonstrate factorial calculation using recursion.FactorialTest.javafor unit testing.🧠 Algorithm Overview:
The factorial of a non-negative integer
nis defined as:Time Complexity: O(n)
Space Complexity: O(n) (recursive stack)
clang-format -i --style=file path/to/your/file.java