Repository navigation
Comparing changes
Open a pull request
base repository: Jojal/Java
base: master
head repository: TheAlgorithms/Java
compare: master
- 19 commits
- 34 files changed
- 13 contributors
Commits on Nov 12, 2026
-
fix(maths): correct coordinate subtraction in DistanceFormula.euclide…
…anDistance (TheAlgorithms#7747)
Configuration menu - View commit details
-
Copy full SHA for 02ebe07 - Browse repository at this point
Copy the full SHA 02ebe07View commit details -
chore(deps): bump github/codeql-action from 4.39.2 to 4.39.3 in /.git…
…hub/workflows (TheAlgorithms#7750) chore(deps): bump github/codeql-action in /.github/workflows Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.39.2 to 4.39.3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v4.39.2...v4.39.3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.39.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>
Configuration menu - View commit details
-
Copy full SHA for 3c4f19d - Browse repository at this point
Copy the full SHA 3c4f19dView commit details -
fix(searches): add null safety and empty matrix handling to RowColumn…
…WiseSorted2dArrayBinarySearch (TheAlgorithms#7725) * fix(searches): add null safety and empty matrix handling to RowColumnWiseSorted2dArrayBinarySearch * refactor(searches): scope validation to rectangular matrices per review
Configuration menu - View commit details
-
Copy full SHA for 07c7ea3 - Browse repository at this point
Copy the full SHA 07c7ea3View commit details
Commits on Nov 13, 2026
-
feat: add MoveZeroes algorithm with tests (TheAlgorithms#7738)
feat: add move-zeroes algorithm with tests
Configuration menu - View commit details
-
Copy full SHA for e9957ea - Browse repository at this point
Copy the full SHA e9957eaView commit details -
Add ChaCha20 stream cipher (TheAlgorithms#7754)
* Add ChaCha20 stream cipher This implementation is intended for educational purposes and should not be used as a replacement for a vetted cryptographic library in production. * Test ChaCha20 implementation * Add test for ChaCha20 handling partial blocks * Refactor CONSTANTS and littleEndianInt method * Refactor ChaCha20Test for clarity and readability Refactored nonce and expected byte array initialization for clarity. Updated test methods to improve readability by reducing line breaks.
Configuration menu - View commit details
-
Copy full SHA for 2f04e81 - Browse repository at this point
Copy the full SHA 2f04e81View commit details
Commits on Nov 14, 2026
-
feat: add RightSideViewOfBinaryTree algorithm with tests (TheAlgorith…
…ms#7734) * feat: add RightSideViewOfBinaryTree algorithm with tests * fix: correct input array for testRightSkewedTree
Configuration menu - View commit details
-
Copy full SHA for 402d3b0 - Browse repository at this point
Copy the full SHA 402d3b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 401e253 - Browse repository at this point
Copy the full SHA 401e253View commit details -
Detect overflow in Pow.pow (TheAlgorithms#7752)
Use Math.multiplyExact for overflow handling in pow
Configuration menu - View commit details
-
Copy full SHA for a006205 - Browse repository at this point
Copy the full SHA a006205View commit details
Commits on Nov 16, 2026
-
chore(deps): bump org.apache.commons:commons-lang3 from 3.21.0 to 3.2…
…2.0 (TheAlgorithms#7759) Bumps org.apache.commons:commons-lang3 from 3.21.0 to 3.22.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-version: 3.22.0 dependency-type: direct:production 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>
Configuration menu - View commit details
-
Copy full SHA for 33f6e94 - Browse repository at this point
Copy the full SHA 33f6e94View commit details
Commits on Nov 17, 2026
-
feat: add TimestampOrderChecker, out of order and duplicate timestamps (
TheAlgorithms#7733) Windowed algorithms assume time moves forward. When it does not, nothing fails loudly: a window holds samples that never coexisted, a rate is computed over a negative interval, a duplicate is counted twice. Retries, buffers flushed after a reconnect, several producers writing into one topic and a clock stepped backwards all cause this, and the cheap defence is to check the order explicitly. Each timestamp is compared with the previous one and classified as INCREASING, DUPLICATE or BACKWARDS. The checker only reports, it does not reorder or drop anything, so lastTimestamp is always the most recent sample, not the largest. It also keeps the worst backwards step, which is what you need to size a reordering buffer. O(1) time per sample and O(1) state; non-finite timestamps are refused. Tests: the first timestamp is always accepted, an ordered stream has no violations, duplicates and backwards steps are counted separately, the worst step is the largest one and not the last one, the stream is not reordered, scan returns one verdict per timestamp, and reset restores the initial state. Signed-off-by: alxkm <19151554+alxkm@users.noreply.github.com> Co-authored-by: alxkm <19151554+alxkm@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for b42e5df - Browse repository at this point
Copy the full SHA b42e5dfView commit details -
fix(maths): ensure non-composite inputs are rejected in SmithNumber (T…
…heAlgorithms#7756) - Reject numbers <= 3 as Smith numbers must be composite (greater than 3) - Fix bug where isSmithNumber(0) incorrectly returned true - Prevent integer overflow in trial division loop condition by using (long) i * i - Add comprehensive test cases covering non-composite inputs (negative numbers, 0, 1), primes, and valid Smith numbers
Configuration menu - View commit details
-
Copy full SHA for e79b0f1 - Browse repository at this point
Copy the full SHA e79b0f1View commit details
Commits on Nov 19, 2026
-
fix(heaps): prevent premature termination and return sorted array in …
…MinPriorityQueue.heapSort (TheAlgorithms#7765) fix(heaps): prevent premature loop termination and return sorted elements in MinPriorityQueue.heapSort
Configuration menu - View commit details
-
Copy full SHA for c1a7f8d - Browse repository at this point
Copy the full SHA c1a7f8dView commit details
Commits on Nov 20, 2026
-
Configuration menu - View commit details
-
Copy full SHA for f4d6708 - Browse repository at this point
Copy the full SHA f4d6708View commit details
Commits on Nov 23, 2026
-
chore(deps): bump actions/setup-java from 6.2.0 to 6.3.0 in /.github/…
…workflows (TheAlgorithms#7775) chore(deps): bump actions/setup-java in /.github/workflows Bumps [actions/setup-java](https://github.com/actions/setup-java) from 6.2.0 to 6.3.0. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](actions/setup-java@v6.2.0...v6.3.0) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: 6.3.0 dependency-type: direct:production 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>
Configuration menu - View commit details
-
Copy full SHA for 9e216aa - Browse repository at this point
Copy the full SHA 9e216aaView commit details
Commits on Nov 24, 2026
-
fix: prevent digit position overflow in OctalToBinary for large octal…
… inputs (TheAlgorithms#7776) * fix: use long digit position in OctalToBinary digitPosition grew as an int and overflowed for octal inputs with 5 or more digits, so convertOctalToBinary(10000) returned a negative value instead of 1000000000000. Making it a long keeps the position exact for the full range the method can represent. * test: cover OctalToBinary inputs with 5+ octal digits Fails on the current implementation because digitPosition overflowed int; passes with the long fix.
Configuration menu - View commit details
-
Copy full SHA for 54d056d - Browse repository at this point
Copy the full SHA 54d056dView commit details -
fix: normalize Playfair key before building the matrix (TheAlgorithms…
…#7779) * fix: normalize Playfair key before building the matrix encrypt() normalizes the plaintext (uppercase, J folded into I, non-letters stripped) but the constructor passed the raw key straight into the matrix builder. A lowercase key like "monarchy" or one containing J or punctuation produced a wrong matrix, so ciphertext was garbage and Z could never round-trip. Normalize the key the same way before building the matrix. * test: cover Playfair keys that are lowercase, contain J, or have non-letters Regression tests for the key-normalization fix: a lowercase key must behave like its uppercase form, a key containing J must still cover Z in the matrix, and punctuation or digits in the key must be ignored. --------- Co-authored-by: Oleksandr <19151554+alxkm@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 9870de2 - Browse repository at this point
Copy the full SHA 9870de2View commit details -
fix: reject Hill cipher keys whose determinant is not coprime with 26 (…
…TheAlgorithms#7780) * fix: reject Hill cipher keys whose determinant is not coprime with 26 The old validation only rejected a determinant of zero modulo 26. A key matrix is invertible mod 26 only when gcd(det, 26) = 1, so keys with determinant 2, 13, etc. passed validation but made encryption lossy: with key [[1,0],[0,2]] both "AA" and "AN" encrypt to "AA". Check coprimality instead, using floorMod so negative determinants are classified correctly. * test: cover Hill cipher keys with determinant 2, 13, or negative coprime Regression tests for the key-validation fix: keys with determinant 2 or 13 must be rejected even though they are not zero mod 26, and a key with determinant -1 (coprime) must still be accepted. --------- Co-authored-by: Oleksandr <19151554+alxkm@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for c86ec0a - Browse repository at this point
Copy the full SHA c86ec0aView commit details -
fix(misc): prevent overflow when averaging the two middle values of a…
… running median (TheAlgorithms#7781) fix(misc): prevent overflow when averaging the two middle values MedianOfRunningArrayInteger and MedianOfRunningArrayLong both compute (a + b) / 2, which overflows once the two middle values of the stream are large. For an Integer stream holding Integer.MAX_VALUE and Integer.MAX_VALUE - 2 the median came back as -2 instead of 2147483646; the Long version fails the same way near Long.MAX_VALUE. Sum in a long for the Integer case, and in a BigInteger for the Long case since there is no wider primitive. Add regression tests for both types at each end of their range. Co-authored-by: Oleksandr <19151554+alxkm@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 15a4a9d - Browse repository at this point
Copy the full SHA 15a4a9dView commit details
Commits on Nov 27, 2026
-
chore(deps): bump github/codeql-action from 4.39.3 to 4.39.4 in /.git…
…hub/workflows (TheAlgorithms#7786) chore(deps): bump github/codeql-action in /.github/workflows Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.39.3 to 4.39.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v4.39.3...v4.39.4) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.39.4 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>
Configuration menu - View commit details
-
Copy full SHA for 3e421bc - Browse repository at this point
Copy the full SHA 3e421bcView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...master