This repository was archived by the owner on Aug 14, 2023. It is now read-only.
forked from TheAlgorithms/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] master from TheAlgorithms:master #52
Open
pull
wants to merge
1,679
commits into
dzndl:master
Choose a base branch
from
TheAlgorithms:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Co-authored-by: DenizAltunkapan <DenizAltunkapan@users.noreply.github.com>
* testing: improve BloomFilterTest * style: fix formatting
* testing: improve testing CRCAlgorithmTest * style: formatting fix
testing: improve MergeKSortedLinkedListTest Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* Refactored ReverseStringUsingStack * Add ReverseStringUsingStack * Refactored ReverseStringUsingStack * Closes #6451
…6460) Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.27.3 to 3.27.4. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](assertj/assertj@assertj-build-3.27.3...assertj-build-3.27.4) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-version: 3.27.4 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…0.0 (#6461) Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.26.1 to 11.0.0. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](checkstyle/checkstyle@checkstyle-10.26.1...checkstyle-11.0.0) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-version: 11.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…6464) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add Hopcroft-Karp algorithm and tests * Adding wikipedia url for Algorithm * fixing test issues * remove unused field flagged by PMD
Co-authored-by: DenizAltunkapan <DenizAltunkapan@users.noreply.github.com>
* Add DFS with parent-completion constraint for DAG traversal
* warning in PartitionProblem.java affecting tests
* added clang-format and updated javadoc
* optimized imports and rechecked camelCase format in tests
* removed .* import and made small visual change
* replaced a inline return with correct {} block
* Removed changed in PartitionProblem.java, Renamed class name to be straightforward about the implementation.Added full names instead of shortcuts, and included record.
* updated for clang format
---------
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
Co-authored-by: DenizAltunkapan <DenizAltunkapan@users.noreply.github.com>
…6471) Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.18.0 to 5.19.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](mockito/mockito@v5.18.0...v5.19.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-version: 5.19.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
refactor: Move methods from `others` package to their respective packages
…o 7.6.13 (#6477) * chore(deps): bump com.mebigfatguy.fb-contrib:fb-contrib Bumps [com.mebigfatguy.fb-contrib:fb-contrib](https://github.com/mebigfatguy/fb-contrib) from 7.6.12 to 7.6.13. - [Commits](mebigfatguy/fb-contrib@v7.6.12...v7.6.13) --- updated-dependencies: - dependency-name: com.mebigfatguy.fb-contrib:fb-contrib dependency-version: 7.6.13 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: exclude `SPP_FIELD_COULD_BE_STATIC` --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vil02 <65706193+vil02@users.noreply.github.com>
Co-authored-by: vil02 <vil02@users.noreply.github.com>
* fix: revert ReverseStack deletions and ensure lint compliance * Fix formatting for ReverseStack and test files * Delete ReverseStackUsingRecursion and its test as requested --------- Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
#6499) Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](actions/setup-java@v4...v5) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
…3.2 to 4.9.4.0 (#6498) * chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.9.3.2 to 4.9.4.0. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.9.3.2...spotbugs-maven-plugin-4.9.4.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.9.4.0 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: exclude `SF_SWITCH_FALLTHROUGH` --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com> Co-authored-by: vil02 <65706193+vil02@users.noreply.github.com>
…6504) * Migrate recursive reverse string method and tests to ReverseString - Moved recursive reverse method from ReverseStringRecursive.java to ReverseString.java - Moved tests from ReverseStringRecursiveTest.java to ReverseStringTest.java - Deleted old ReverseStringRecursive files * Fix formatting for ReverseStringTest.java as per clang-format linter
…4.0 to 4.9.4.1 (#6515) chore(deps): bump com.github.spotbugs:spotbugs-maven-plugin Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.9.4.0 to 4.9.4.1. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.9.4.0...spotbugs-maven-plugin-4.9.4.1) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.9.4.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…o 7.6.14 (#6517) chore(deps): bump com.mebigfatguy.fb-contrib:fb-contrib Bumps [com.mebigfatguy.fb-contrib:fb-contrib](https://github.com/mebigfatguy/fb-contrib) from 7.6.13 to 7.6.14. - [Commits](mebigfatguy/fb-contrib@v7.6.13...v7.6.14) --- updated-dependencies: - dependency-name: com.mebigfatguy.fb-contrib:fb-contrib dependency-version: 7.6.14 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* Added-> DisjointUnion Set by Size * Add tests for DisjointSetUnionBySize --------- Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
Co-authored-by: DenizAltunkapan <DenizAltunkapan@users.noreply.github.com>
…6519) Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](actions/stale@v9...v10) --- updated-dependencies: - dependency-name: actions/stale dependency-version: '10' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ows (#6520) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v5...v6) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…o 2025-08-25-18-17-39 (#6523) chore(deps): bump gitpod/workspace-java-21 Bumps gitpod/workspace-java-21 from 2025-06-18-16-47-14 to 2025-08-25-18-17-39. --- updated-dependencies: - dependency-name: gitpod/workspace-java-21 dependency-version: 2025-08-25-18-17-39 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Implement LengthOfLastWord algorithm in strings package * Add JUnit tests for LengthOfLastWord algorithm * style: fix import order and spacing for clang-format
* Add recursive factorial implementation with tests * [STYLE] Apply clang-format * Move recursive factorial to recursion package and remove duplicate * Move recursive factorial to recursion package and remove duplicate * Apply clang-format to factorial recursion tests * Apply clang-format to factorial recursion tests --------- Co-authored-by: Koushik Sai <nyamathabadkoushik@gmail.com> Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
* Add immutable HashMap implementation * Add immutable HashMap implementation * Applied clang-format --------- Co-authored-by: Koushik Sai <nyamathabadkoushik@gmail.com>
* Add StochasticMatrix utility class This class provides methods to check if a matrix is row-stochastic or column-stochastic, ensuring all elements are non-negative and the sums of rows or columns equal 1. * Change package from maths to matrix Updated package declaration for StochasticMatrix class. * Change package declaration in StochasticMatrixTest * Delete src/test/java/com/thealgorithms/StochasticMatrixTest.java * Refactor matrix initialization for test cases * Fix formatting of matrix initialization in tests * Remove unnecessary newline in StochasticMatrix * Add import statement for JUnit in StochasticMatrixTest * Add additional assertions to StochasticMatrixTest * Clean up import statements in StochasticMatrixTest Removed unused import statements for cleaner code. * Reorder import statements in StochasticMatrixTest * Remove unused import assertThrows from StochasticMatrixTest Removed unused import for assertThrows.
* Added 0/1 Knapsack Algorithm using Dynamic Programming in Java * Fix Checkstyle whitespace issues in Knapsack.java * Formatted Knapsack.java to pass linter and added 0/1 Knapsack algorithm * Formatted Knapsack.java to pass linter and added 0/1 Knapsack algorithm * Formatted Knapsack.java to pass linter and added 0/1 Knapsack algorithm * Formatted Knapsack.java to pass linter and added 0/1 Knapsack algorithm --------- Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
Co-authored-by: DenizAltunkapan <DenizAltunkapan@users.noreply.github.com>
* Add checklist item for test class inclusion * Update pull request template for algorithm tests
….1 (#7188) Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 12.3.0 to 12.3.1. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](checkstyle/checkstyle@checkstyle-12.3.0...checkstyle-12.3.1) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-version: 12.3.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add detailed JavaDoc for AllPathsFromSourceToTarget
….0 (#7193) Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 12.3.1 to 13.0.0. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](checkstyle/checkstyle@checkstyle-12.3.1...checkstyle-13.0.0) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-version: 13.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](junit-team/junit-framework@r6.0.1...r6.0.2) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…thub/workflows (#7199) chore(deps): bump peter-evans/create-pull-request in /.github/workflows Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 7 to 8. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](peter-evans/create-pull-request@v7...v8) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: implement Smooth Sort algorithm with detailed JavaDoc and test class * style: format LEONARDO array for improved readability with clang-format --------- Co-authored-by: Ahmed Allam <60698204+AllamF5J@users.noreply.github.com>
* Add Count Nice Subarrays sliding window algorithm * Add detailed comments and reference to CountNiceSubarrays * Fix clang-format issues in CountNiceSubarrays * Added extra edge cases * changes made
* feat: implement Smooth Sort algorithm with detailed JavaDoc and test class * style: format LEONARDO array for improved readability with clang-format * feat(sorts): add TournamentSort (winner-tree) * test: add unit test for null array handling in TournamentSort --------- Co-authored-by: Ahmed Allam <60698204+AllamF5J@users.noreply.github.com> Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com> Co-authored-by: Oleksandr Klymenko <19151554+alxkm@users.noreply.github.com>
* feat: implement Smooth Sort algorithm with detailed JavaDoc and test class * style: format LEONARDO array for improved readability with clang-format * feat(sorts): add TournamentSort (winner-tree) * test: add unit test for null array handling in TournamentSort * feat(search): add rotated binary search * test: add unit test for handling middle element in right sorted half of rotated array --------- Co-authored-by: Ahmed Allam <60698204+AllamF5J@users.noreply.github.com>
…2 to 7.7.3 (#7211) chore(deps-dev): bump com.mebigfatguy.fb-contrib:fb-contrib Bumps [com.mebigfatguy.fb-contrib:fb-contrib](https://github.com/mebigfatguy/fb-contrib) from 7.7.2 to 7.7.3. - [Commits](mebigfatguy/fb-contrib@v7.7.2...v7.7.3) --- updated-dependencies: - dependency-name: com.mebigfatguy.fb-contrib:fb-contrib dependency-version: 7.7.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: implement Smooth Sort algorithm with detailed JavaDoc and test class * style: format LEONARDO array for improved readability with clang-format * feat: add MiddleOfLinkedList class and corresponding test cases * docs: update documentation for MiddleOfLinkedList class * test: refactor MiddleOfLinkedListTest to improve readability and assertions * test: refactor MiddleOfLinkedListTest for improved null safety and readability --------- Co-authored-by: Ahmed Allam <60698204+AllamF5J@users.noreply.github.com>
* docs: add Javadoc to FibonacciSeries * fix: make small adjustment --------- Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
…earch (#7216) Added input validation and clarify sorted array rrequirement in Binary Search
* feat: added Bell Numbers algorithm using Aitken's Array * style: applied clang-format fixes
Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
* Add distance between two points algorithm * Create DistanceBetweenTwoPointsTest.java * DistanceBetweenTwoPoints.java * Fix test file package and project structure * Delete src/test/java/com/thealgorithms/DistanceBetweenTwoPointsTest.java * Apply clang-format compliant formatting * Apply clang-format --------- Co-authored-by: a <19151554+alxkm@users.noreply.github.com>
…3 to 7.7.4 (#7222) * chore(deps-dev): bump com.mebigfatguy.fb-contrib:fb-contrib Bumps [com.mebigfatguy.fb-contrib:fb-contrib](https://github.com/mebigfatguy/fb-contrib) from 7.7.3 to 7.7.4. - [Commits](mebigfatguy/fb-contrib@v7.7.3...v7.7.4) --- updated-dependencies: - dependency-name: com.mebigfatguy.fb-contrib:fb-contrib dependency-version: 7.7.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: supporess new warnings --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vil02 <65706193+vil02@users.noreply.github.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )