Skip to content

implemented chinese remainder theorem with tests #5871

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

Closed
wants to merge 1 commit into from
Closed

implemented chinese remainder theorem with tests #5871

wants to merge 1 commit into from

Conversation

SuprHUlk
Copy link
Contributor

Description of Change

This pull request implements the Chinese Remainder Theorem (CRT) algorithm to solve issue #5772.

The implementation includes:

  • A function (solveCRT) that calculates the solution using the product of moduli and their modular inverses.
  • A helper method (modInverse) that computes the modular inverse using the Extended Euclidean Algorithm.
  • Detailed documentation adhering to Doxygen standards, with a reference to Wikipedia for further details.
  • Comprehensive unit tests that verify the implementation across different scenarios, including simple cases, larger numbers, and edge cases to ensure accuracy and reliability.

Checklist

  • 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.

@SuprHUlk SuprHUlk closed this Oct 16, 2024
@SuprHUlk SuprHUlk reopened this Oct 16, 2024
@SuprHUlk SuprHUlk closed this Oct 16, 2024
@SuprHUlk SuprHUlk deleted the chinese-remainder branch October 16, 2024 11:36
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.

1 participant