Skip to content

refactor ShuffleArray: improve documentation and maintainability #6357

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

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

alxkm
Copy link
Contributor

@alxkm alxkm commented Jul 8, 2025

Changes Introduced:

  • Refactored ShuffleArray to ensure clarity, maintainability.
  • Improved JavaDocs. Clear explanation of the Fisher–Yates shuffle algorithm.
  • In-place shuffle logic preserved, but made more readable and self-documenting.
  • 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 Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.60%. Comparing base (4768987) to head (7f0c25e).

Files with missing lines Patch % Lines
...main/java/com/thealgorithms/misc/ShuffleArray.java 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6357      +/-   ##
============================================
- Coverage     74.61%   74.60%   -0.02%     
- Complexity     5448     5450       +2     
============================================
  Files           682      682              
  Lines         19017    19022       +5     
  Branches       3677     3677              
============================================
+ Hits          14190    14191       +1     
- Misses         4269     4271       +2     
- Partials        558      560       +2     

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

Copy link

@R-Oskar R-Oskar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem like reasonable changes.

@DenizAltunkapan DenizAltunkapan merged commit c997a32 into TheAlgorithms:master Jul 9, 2025
6 of 7 checks passed
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.

4 participants