Skip to content

Conversation

Ayush41
Copy link

@Ayush41 Ayush41 commented Oct 11, 2025

Description

This PR adds an implementation of the Factorial algorithm using recursion under the com.thealgorithms.recursion package.

✅ Summary:

  • Added Factorial.java to demonstrate factorial calculation using recursion.
  • Added corresponding test file FactorialTest.java for unit testing.
  • Follows the repository’s structure, documentation style, and naming conventions.
  • Includes exception handling for negative inputs.

🧠 Algorithm Overview:

The factorial of a non-negative integer n is defined as:
Time Complexity: O(n)
Space Complexity: O(n) (recursive stack)

  • 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-commenter
Copy link

codecov-commenter commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.11%. Comparing base (14a23b7) to head (d369bd5).

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.
📢 Have feedback on the report? Share it here.

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

@Ayush41 Ayush41 marked this pull request as ready for review October 11, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants