Java icon indicating copy to clipboard operation
Java copied to clipboard

Add factorial recursion

Open konduri-lakshmi-prasanna opened this issue 1 month ago • 3 comments

  • [ ] I have read CONTRIBUTING.md.
  • [ ] This pull request is all my own work -- I have not plagiarized it.
  • [ ] All filenames are in PascalCase.
  • [ ] All functions and variable names follow Java naming conventions.
  • [ ] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • [ ] All new code is formatted with clang-format -i --style=file path/to/your/file.java

Codecov Report

:x: Patch coverage is 74.28571% with 9 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 77.83%. Comparing base (b312567) to head (d616361).

Files with missing lines Patch % Lines
...in/java/com/thealgorithms/recursion/Factorial.java 0.00% 7 Missing :warning:
...java/com/thealgorithms/strings/StringRotation.java 75.00% 2 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6794      +/-   ##
============================================
- Coverage     77.84%   77.83%   -0.02%     
- Complexity     6394     6405      +11     
============================================
  Files           733      736       +3     
  Lines         21333    21368      +35     
  Branches       4183     4188       +5     
============================================
+ Hits          16607    16632      +25     
- Misses         4058     4067       +9     
- Partials        668      669       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Oct 15 '25 16:10 codecov-commenter

Please notice the duplicate FactorialRecursion.java.

Also please open one PR for one algorithm (and tests of it) - it is easier to review.

vil02 avatar Oct 18 '25 17:10 vil02

Added a recursive implementation of the factorial algorithm under com.thealgorithms.recursion. Includes proper input validation for negative numbers Added comprehensive JUnit test cases Conforms to repository checkstyle (private constructor for utility class)