Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sohamcodes-ctrl/Java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: TheAlgorithms/Java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 20 commits
  • 31 files changed
  • 6 contributors

Commits on Aug 29, 2026

  1. chore(deps): bump github/codeql-action from 4.37.7 to 4.37.8 in /.git…

    …hub/workflows (TheAlgorithms#7584)
    
    chore(deps): bump github/codeql-action in /.github/workflows
    
    Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.7 to 4.37.8.
    - [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.37.7...v4.37.8)
    
    ---
    updated-dependencies:
    - dependency-name: github/codeql-action
      dependency-version: 4.37.8
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Aug 29, 2026
    Configuration menu
    Copy the full SHA
    9a13ce0 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2026

  1. chore(deps): bump actions/setup-java from 5.7.0 to 6.0.0 in /.github/…

    …workflows (TheAlgorithms#7587)
    
    chore(deps): bump actions/setup-java in /.github/workflows
    
    Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.7.0 to 6.0.0.
    - [Release notes](https://github.com/actions/setup-java/releases)
    - [Commits](actions/setup-java@v5.7.0...v6.0.0)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-java
      dependency-version: 6.0.0
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 1, 2026
    Configuration menu
    Copy the full SHA
    ffb3bed View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2026

  1. chore(deps): bump github/codeql-action from 4.37.8 to 4.37.9 in /.git…

    …hub/workflows (TheAlgorithms#7589)
    
    chore(deps): bump github/codeql-action in /.github/workflows
    
    Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.8 to 4.37.9.
    - [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.37.8...v4.37.9)
    
    ---
    updated-dependencies:
    - dependency-name: github/codeql-action
      dependency-version: 4.37.9
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 3, 2026
    Configuration menu
    Copy the full SHA
    6ec6339 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2026

  1. Add K-Nearest Neighbors classifier (TheAlgorithms#7563)

    * Add K-Nearest Neighbors classifier
    
    * Fix checkstyle issues
    
    * Improve test coverage
    
    * Apply clang-format formatting
    
    * Refine KNN validation and data handling
    
    * Fix KNN test formatting
    
    * Fix KNN test formatting
    
    ---------
    
    Co-authored-by: A <[email protected]>
    poorva0405 and alxkm authored Sep 4, 2026
    Configuration menu
    Copy the full SHA
    0a6c756 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2026

  1. feat: add SlidingWindowAggregator, a ring buffer with windowed aggreg…

    …ation (TheAlgorithms#7591)
    
    A fixed-capacity circular buffer that additionally keeps an aggregate of
    every element it currently holds, so a sliding window sum, minimum or
    maximum is available in constant time.
    
    Rather than the usual "add the new value, subtract the evicted one"
    trick, which only works for invertible operators, it uses the two-stack
    sliding window aggregation algorithm: the window is split into a front
    section holding suffix aggregates and a back section summarised by a
    single running aggregate. Every element takes part in at most one
    rotation between the two, which makes insertion and removal O(1)
    amortised with no allocation after construction. Any associative
    operator works, commutative or not, and no identity element is needed.
    
    Comes with factories for sum, minimum and maximum, indexed access, a
    fail-fast iterator, and tests that check the aggregate against a brute
    force reference under randomly interleaved insertions and removals.
    
    Signed-off-by: alxkm <[email protected]>
    Co-authored-by: alxkm <[email protected]>
    alxkm and alxkm authored Sep 6, 2026
    Configuration menu
    Copy the full SHA
    14c8db8 View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2026

  1. chore(deps): bump com.puppycrawl.tools:checkstyle from 14.0.0 to 14.1…

    ….0 (TheAlgorithms#7594)
    
    Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 14.0.0 to 14.1.0.
    - [Release notes](https://github.com/checkstyle/checkstyle/releases)
    - [Commits](checkstyle/checkstyle@checkstyle-14.0.0...checkstyle-14.1.0)
    
    ---
    updated-dependencies:
    - dependency-name: com.puppycrawl.tools:checkstyle
      dependency-version: 14.1.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 8, 2026
    Configuration menu
    Copy the full SHA
    8f08a92 View commit details
    Browse the repository at this point in the history
  2. chore(deps-dev): bump org.apache.maven.plugins:maven-compiler-plugin …

    …from 3.15.0 to 3.16.0 (TheAlgorithms#7595)
    
    chore(deps-dev): bump org.apache.maven.plugins:maven-compiler-plugin
    
    Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.15.0 to 3.16.0.
    - [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
    - [Commits](apache/maven-compiler-plugin@maven-compiler-plugin-3.15.0...maven-compiler-plugin-3.16.0)
    
    ---
    updated-dependencies:
    - dependency-name: org.apache.maven.plugins:maven-compiler-plugin
      dependency-version: 3.16.0
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Oleksandr Klymenko <[email protected]>
    dependabot[bot] and alxkm authored Sep 8, 2026
    Configuration menu
    Copy the full SHA
    06f0480 View commit details
    Browse the repository at this point in the history
  3. chore(deps-dev): bump org.apache.maven.plugins:maven-surefire-plugin …

    …from 3.5.6 to 3.6.0 (TheAlgorithms#7596)
    
    chore(deps-dev): bump org.apache.maven.plugins:maven-surefire-plugin
    
    Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.6 to 3.6.0.
    - [Release notes](https://github.com/apache/maven-surefire/releases)
    - [Commits](apache/maven-surefire@surefire-3.5.6...surefire-3.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: org.apache.maven.plugins:maven-surefire-plugin
      dependency-version: 3.6.0
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Oleksandr Klymenko <[email protected]>
    dependabot[bot] and alxkm authored Sep 8, 2026
    Configuration menu
    Copy the full SHA
    1c0c7c0 View commit details
    Browse the repository at this point in the history
  4. feat: add KalmanFilter, a scalar Kalman filter with sensor fusion (T…

    …heAlgorithms#7592)
    
    feat: add KalmanFilter, a scalar Kalman filter with sensor fusion
    
    Signed-off-by: alxkm <[email protected]>
    Co-authored-by: alxkm <[email protected]>
    alxkm and alxkm authored Sep 8, 2026
    Configuration menu
    Copy the full SHA
    ad10eda View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8abfcf7 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2026

  1. Configuration menu
    Copy the full SHA
    d93d0ea View commit details
    Browse the repository at this point in the history
  2. feat: add EwmaChangeDetector, an EWMA control chart for streams (TheA…

    …lgorithms#7600)
    
    Adds an exponentially weighted moving average control chart that flags level shifts in a stream in O(1) time and memory per sample, with an exact variance-based control band so that the warm-up does not trip false alarms.
    
    It builds on a new reusable ExponentialMovingAverage (alpha, span or half-life parameterisation, and the exponentially weighted variance of the same stream) and shares the ShiftSignal verdict enum with CusumDetector, out of which it is extracted to the package level so that both detectors report the same type.
    
    Signed-off-by: alxkm <[email protected]>
    Co-authored-by: alxkm <[email protected]>
    alxkm and alxkm authored Sep 9, 2026
    Configuration menu
    Copy the full SHA
    1f08afb View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2026

  1. feat: add WelfordAlgorithm, online mean and variance in one pass (The…

    …Algorithms#7602)
    
    Welford's recurrence keeps a running mean and the sum of squared deviations from it, so it never forms the large nearly equal intermediate values that make the textbook variance formula lose its significant digits, and it needs O(1) time per sample and O(1) memory regardless of the stream length.
    
    Beyond the plain accumulation it supports removal, which runs the recurrence backwards and turns the accumulator into the statistics of a sliding window, and a static merge implementing Chan's parallel update so partial results from different shards combine exactly.
    
    Signed-off-by: alxkm <[email protected]>
    Co-authored-by: alxkm <[email protected]>
    alxkm and alxkm authored Sep 11, 2026
    Configuration menu
    Copy the full SHA
    a097a28 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2026

  1. feat: add P2QuantileEstimator, one quantile of a stream in constant m…

    …emory (TheAlgorithms#7603)
    
    The P-square algorithm of Jain and Chlamtac keeps five markers instead of the samples, so a quantile of an unbounded stream costs O(1) time per sample and O(1) memory. Each marker is nudged towards its desired position with a piecewise parabolic prediction, falling back to a linear one whenever the parabola would break the ordering of the heights.
    
    The first five samples are kept verbatim, so the estimate is exact until the sixth arrives, and the minimum and maximum stay exact for the whole stream.
    
    Signed-off-by: alxkm <[email protected]>
    Co-authored-by: alxkm <[email protected]>
    alxkm and alxkm authored Sep 12, 2026
    Configuration menu
    Copy the full SHA
    c99b056 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2026

  1. chore(deps-dev): bump com.github.spotbugs:spotbugs-maven-plugin from …

    …4.10.4.0 to 4.10.4.1 (TheAlgorithms#7605)
    
    chore(deps-dev): bump com.github.spotbugs:spotbugs-maven-plugin
    
    Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.10.4.0 to 4.10.4.1.
    - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
    - [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.10.4.0...spotbugs-maven-plugin-4.10.4.1)
    
    ---
    updated-dependencies:
    - dependency-name: com.github.spotbugs:spotbugs-maven-plugin
      dependency-version: 4.10.4.1
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 15, 2026
    Configuration menu
    Copy the full SHA
    b6fb8ad View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2026

  1. chore(deps): bump actions/setup-java from 6.0.0 to 6.0.1 in /.github/…

    …workflows (TheAlgorithms#7607)
    
    chore(deps): bump actions/setup-java in /.github/workflows
    
    Bumps [actions/setup-java](https://github.com/actions/setup-java) from 6.0.0 to 6.0.1.
    - [Release notes](https://github.com/actions/setup-java/releases)
    - [Commits](actions/setup-java@v6.0.0...v6.0.1)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-java
      dependency-version: 6.0.1
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 17, 2026
    Configuration menu
    Copy the full SHA
    d652955 View commit details
    Browse the repository at this point in the history
  2. chore(deps): bump github/codeql-action from 4.37.9 to 4.38.0 in /.git…

    …hub/workflows (TheAlgorithms#7608)
    
    chore(deps): bump github/codeql-action in /.github/workflows
    
    Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.9 to 4.38.0.
    - [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.37.9...v4.38.0)
    
    ---
    updated-dependencies:
    - dependency-name: github/codeql-action
      dependency-version: 4.38.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: a <[email protected]>
    dependabot[bot] and alxkm authored Sep 17, 2026
    Configuration menu
    Copy the full SHA
    b3a96d2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    734a7a4 View commit details
    Browse the repository at this point in the history
  4. feat: add Adwin, an adaptive window that cuts itself when the stream …

    …changes (TheAlgorithms#7606)
    
    ADWIN keeps a window of recent values and, after every sample, looks for a split into an old and a recent part whose means differ by more than a variance sensitive Hoeffding bound. When it finds one the old part is dropped, so the window grows while the stream is stationary and collapses as soon as it moves, and its length becomes an estimate of how long the current regime has lasted rather than a parameter to tune.
    
    The window is stored as an exponential histogram, buckets of 1, 2, 4 ... elements with at most five of each size, so a window of n elements needs O(log n) buckets and cuts are tried only at bucket boundaries. The bucket merge carries the sum and the variance exactly, which the tests check against a direct computation over 2000 samples.
    
    Signed-off-by: alxkm <[email protected]>
    Co-authored-by: alxkm <[email protected]>
    alxkm and alxkm authored Sep 17, 2026
    Configuration menu
    Copy the full SHA
    a0c3eb5 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2026

  1. Sigmoid Activation function implementation with simplified batch calc… (

    TheAlgorithms#7609)
    
    * Sigmoid Activation function implementation with simplified batch calculation
    
    * clang formatted
    
    * braces
    
    * private constructor added
    
    * final + clang-format
    
    * Update src/main/java/com/thealgorithms/maths/SigmoidActivation.java
    
    Co-authored-by: Oleksandr Klymenko <[email protected]>
    
    * Update src/main/java/com/thealgorithms/maths/SigmoidActivation.java
    
    Co-authored-by: a <[email protected]>
    
    ---------
    
    Co-authored-by: a <[email protected]>
    crapxxi and alxkm authored Sep 19, 2026
    Configuration menu
    Copy the full SHA
    6bdb1ac View commit details
    Browse the repository at this point in the history
Loading