Skip to content
CAI
Software that uses CAICheck a score

TheAlgorithms/Java

67.4

Adequate · 13 November 2026

79.2k

lines of production code

Java

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add A5/1 stream cipher implementation

Users can now encrypt data using the A5/1 stream cipher algorithm, commonly used in mobile communications. This change introduces the A5Cipher class for encryption operations, an A5KeyStreamGenerator that manages the underlying Linear Feedback Shift Registers (LFSRs) to produce key streams, and supporting classes including BaseLFSR, CompositeLFSR, and Utils for bit manipulation.

src/main/java/com/thealgorithms/ciphers/a5 · high confidence

Add EMA and IIR audio filter implementations

The audio filters module now includes two new filter classes: EMAFilter, which applies an exponential moving average to smooth audio signals using a configurable alpha factor, and IIRFilter, which processes audio samples through an N-order Infinite Impulse Response filter with configurable numerator and denominator coefficients. These additions provide users with new signal processing capabilities for smoothing and shaping audio data.

src/main/java/com/thealgorithms/audiofilters · high confidence

Add ProcessDetails entity for CPU scheduling algorithms

A new ProcessDetails entity class has been added to the devutils package to support CPU scheduling implementations. This class models process attributes including process ID, arrival time, burst time, waiting time, turnaround time, and priority, providing the necessary data structure for algorithms such as First-Come-First-Served (FCFS) and Preemptive Priority Scheduling.

src/main/java/com/thealgorithms/devutils/entities · high confidence

Add SlidingWindowAggregator for windowed data aggregation

A new SlidingWindowAggregator class has been added to the data structures library, providing a fixed-capacity ring buffer that maintains an aggregate of its current elements. It supports operations like sum, minimum, and maximum with O(1) aggregate retrieval and O(1) amortized insertion, using a two-stack algorithm to ensure numerical stability and support non-invertible operators.

src/main/java/com/thealgorithms/datastructures/buffers · high confidence

Add ZigZag Pattern string encoding algorithm

A new ZigZag Pattern encoding algorithm has been added to the strings package. Users can now convert a string into a zig-zagged format by specifying the number of rows, with the implementation handling edge cases where the string length is smaller than the number of rows or the row count is less than two.

src/main/java/com/thealgorithms/strings/zigZagPattern · high confidence

Add custom BufferedReader implementation for IO operations

A new \BufferedReader\ class has been added to the \com.thealgorithms.io\ package. This implementation mimics the behavior of the standard Java \BufferedReader\ but includes additional capabilities such as \peek(n)\ for lookahead and \readBlock()\ to read chunks of data. It allows users to read from byte arrays or input streams with a configurable buffer size, providing a specialized tool for buffered input processing within the algorithms library.

src/main/java/com/thealgorithms/io · high confidence

Add generic Node class for tree structures

A new generic Node class has been added to the data structures library, allowing nodes to hold values of any type and maintain a list of child nodes. This provides a reusable, type-safe building block for implementing tree-based algorithms like DFS and BFS.

src/main/java/com/thealgorithms/datastructures · high confidence

Add generic node and tree node data structures

The \devutils.nodes\ package now includes a set of generic classes to represent linked list and tree structures: \Node\ as the base class for node data, \SimpleNode\ for singly-linked lists, \TreeNode\ as the base for trees with parent references and depth tracking, \SimpleTreeNode\ for binary trees with left/right children, and \LargeTreeNode\ for trees with a collection of child nodes. These classes provide standard getters, setters, and utility methods like \isLeafNode()\ and \isRootNode()\ to support algorithm implementations.

src/main/java/com/thealgorithms/devutils/nodes · high confidence

Added Bag data structure implementation

A new generic Bag collection has been introduced in the data structures package. This implementation allows users to add elements and iterate over them while preserving insertion order, supports duplicate entries, and provides methods to check for membership and size. It does not support element removal and is not thread-safe.

src/main/java/com/thealgorithms/datastructures/bags · high confidence

Added Cohen-Sutherland and Liang-Barsky line clipping algorithms

Users can now clip line segments against a rectangular window using two new algorithms: Cohen-Sutherland and Liang-Barsky. The Cohen-Sutherland implementation uses region codes to efficiently determine if a line is inside, outside, or partially inside the clipping area, while the Liang-Barsky implementation uses parametric equations to calculate intersection points with window boundaries. Both algorithms are supported by new utility classes for representing Points and Lines.

src/main/java/com/thealgorithms/lineclipping · high confidence

Added Disjoint Set Union data structure implementations

Added new Java implementations of the Disjoint Set Union (Union-Find) data structure to the algorithms library. This includes a base implementation using union by rank, a new implementation using union by size, and a shared Node class to support these structures, providing users with efficient tools for managing disjoint sets.

src/main/java/com/thealgorithms/datastructures/disjointsetunion · high confidence

Added Tower of Hanoi and Word Boggle puzzle solvers

New puzzle-solving algorithms have been added to the library: a recursive solution for the Tower of Hanoi that outputs the sequence of moves, and a Word Boggle solver that uses a Trie data structure to efficiently find valid words on a character board.

src/main/java/com/thealgorithms/puzzlesandgames · high confidence

Expanded CPU scheduling algorithm library

The scheduling package now includes a wide variety of new CPU scheduling algorithms, providing users with diverse options for process management simulations. New additions include Aging, Earliest Deadline First (EDF), First Come First Serve (FCFS), Fair Share, Gang, Highest Response Ratio Next, Job Sequencing with Deadlines, Lottery, Multi-Level Feedback Queue (MLFQ), Multi-Agent, Non-Preemptive Priority, Preemptive Priority, Proportional Fair, Round Robin, Random, Shortest Job First (SJF), Shortest Remaining Time First (SRTF), Self-Adjusting, and Slack Time schedulers. These implementations cover various strategies such as priority-based, time-slice based, deadline-driven, and probabilistic scheduling, allowing for comprehensive testing and educational purposes.

src/main/java/com/thealgorithms/scheduling · high confidence

Expanded dynamic programming algorithm library

The dynamic programming package now includes a wide range of new algorithm implementations, adding capabilities for string manipulation (Abbreviation, Damerau-Levenshtein Distance, Edit Distance, Needleman-Wunsch, Smith-Waterman), combinatorial optimization (0/1 Knapsack via multiple approaches including Brute Force, Memoization, and Tabulation, Partition Problem, Optimal Job Scheduling), and sequence analysis (Climbing Stairs, Coin Change, Fibonacci with Binet's formula, Golomb Sequence, Tribonacci, Longest Increasing/Arithmetic Subsequences, Longest Palindromic Subsequence). Additional additions cover digit-based counting (DigitDP), graph/fill algorithms (Boundary Fill), and various classic DP problems like Board Path, Dice Throw, Egg Dropping, Matrix Chain Multiplication, and Unique Paths.

src/main/java/com/thealgorithms/dynamicprogramming · high confidence

Expanded sorting algorithm library with new implementations and concurrency support

The sorting package now includes a wide range of new algorithm implementations, adding capabilities such as AdaptiveMergeSort, BeadSort, BinaryInsertionSort, BitonicSort, BogoSort, BubbleSort (iterative and recursive), BucketSort, CircleSort, CocktailShakerSort, CombSort, ConcurrentMergeSort, CountingSort, CycleSort, DarkSort, DualPivotQuickSort, DutchNationalFlagSort, ExchangeSort, FlashSort, GnomeSort, HeapSort, and InsertionSort (including sentinel variation). Notably, ConcurrentMergeSort introduces multi-threaded sorting for integer arrays using a ThreadPoolExecutor with automatic fallback to sequential processing for small sub-arrays. These additions provide users with diverse sorting strategies, from standard comparison-based sorts to distribution and parallel approaches, all integrated into the existing SortAlgorithm interface or as standalone utility classes.

src/main/java/com/thealgorithms/sorts · high confidence

Introduction of DynamicArray data structure

A new DynamicArray class has been added to the data structures library, providing a resizable array implementation that automatically expands its capacity when elements are added. This class supports standard operations including adding, retrieving, and removing elements by index, as well as checking for emptiness, size, and containment of specific elements. It also implements the Iterable interface to allow iteration and provides a stream() method for functional-style processing of the contained elements.

src/main/java/com/thealgorithms/datastructures/dynamicarray · high confidence

New CRDT data structures for distributed systems

Added implementations of several Conflict-free Replicated Data Types (CRDTs) to the data structures library, including G-Counter, G-Set, PN-Counter, Two-Phase Set (2P-Set), Last-Write-Wins Element Set (LWWElementSet), and Observed-Remove Set (OR-Set). These additions provide new capabilities for managing shared state in distributed and concurrent environments, supporting operations such as incrementing/decrementing counters, adding/removing elements, and merging states across replicas.

src/main/java/com/thealgorithms/datastructures/crdt · high confidence

New algorithms and utilities added to the 'others' package

The \src/main/java/com/thealgorithms/others\ package now includes several new algorithm implementations: \ArrayLeftRotation\ and \ArrayRightRotation\ for shifting array elements, \BFPRT\ for finding the k-th smallest element in linear time, \BankersAlgorithm\ for deadlock detection, \BoyerMoore\ for majority element detection, \BrianKernighanAlgorithm\ for counting set bits, \CRC16\ and \CRC32\ for checksum generation, \Conway\ for generating the look-and-say sequence, \Damm\ for check digit validation, \FloydTriangle\ for generating number triangles, \GaussLegendre\ for calculating pi, \Huffman\ for data compression, \InsertDeleteInArray\ for array manipulation, \IterativeFloodFill\ for image processing, and \KochSnowflake\ for fractal generation.

src/main/java/com/thealgorithms/misc, src/main/java/com/thealgorithms/others · high confidence

New backtracking algorithms added to the library

The backtracking package now includes a comprehensive set of new algorithm implementations: AllPathsFromSourceToTarget (finding all simple paths in a directed graph), ArrayCombination and Combination (generating combinations of integers or generic arrays), CombinationSum (finding subsets summing to a target), CrosswordSolver (placing words in a grid), FloodFill (recursive image coloring), KnightsTour (solving the Knight's Tour problem with Warnsdorff's rule), MColoring (graph coloring with BFS), MazeRecursion (maze solving with two movement strategies), NQueens (optimized placement using hash sets for diagonal checks), ParenthesesGenerator, Permutation, PowerSum, RatInAMaze (finding all paths in a binary maze), SubsequenceFinder, SudokuSolver, UniquePermutation (handling duplicate characters), and WordPatternMatcher.

src/main/java/com/thealgorithms/backtracking, src/main/java/com/thealgorithms/compression, src/main/java/com/thealgorithms/randomized · high confidence

New bit manipulation algorithms and utilities added

The bit manipulation package now includes a wide range of new algorithms and utility classes. These additions cover binary conversions (BCD, Gray code, Xs3), bit rotation and swapping, GCD computation (including Stein's algorithm and BigInteger support), and various bit inspection tools (counting set bits, leading zeros, highest/lowest set bits, parity, and Hamming distance). Additional features include checking for binary palindromes, generating subsets via bitmasks, finding non-repeating numbers, and implementing basic Boolean logic gates.

src/main/java/com/thealgorithms/bitmanipulation · high confidence

New cache implementations: LFU, LRU, MRU, and RR

Added four new cache data structure implementations to the library: LFUCache (Least Frequently Used), LRUCache (Least Recently Used), MRUCache (Most Recently Used), and RRCache (Random Replacement). These classes provide generic key-value storage with configurable capacities and specific eviction policies, allowing users to manage memory or resource usage by automatically removing entries based on access frequency, recency, or random selection when the cache is full.

src/main/java/com/thealgorithms/datastructures/caches · high confidence

New cipher algorithms and AES mode update

The ciphers package now includes implementations for the ADFGVX, Autokey, Baconian, Affine, and DiffieHellman ciphers, alongside existing algorithms like AES, DES, Blowfish, and ECC. Additionally, the AESEncryption example has been updated to use the more secure AES/GCM/NoPadding mode instead of the default ECB mode.

src/main/java/com/thealgorithms/ciphers · high confidence

New conversion utilities and algorithms added

The conversions package now includes a wide range of new algorithms and utility classes for various data transformations. Users can now convert between coordinate systems (Cartesian and Polar), transform integers to English words or Roman numerals, and handle network address formats (IPv4/IPv6 mapping, IPv4 to binary). Additional support has been added for base conversions (any base to any base, decimal to any base), encoding schemes (Base64), and specific numeric conversions (binary, octal, hexadecimal, endian, affine transformations, and temperature units).

src/main/java/com/thealgorithms/conversions · high confidence

New cryptographic, compression, and data structure algorithms added

This update introduces several new algorithms and data structures to the library. In cryptography, it adds Elliptic Curve Cryptography (ECC), ElGamal encryption with safe prime generation, Winternitz one-time signatures (WOTS), and the A5 cipher components (CompositeLFSR and LFSR). For data compression, it includes implementations of LZ77, LZ78, and Arithmetic Coding. Additionally, it adds a Bloom Filter for probabilistic set membership, a Circular Buffer for FIFO operations with overwrite behavior, and a thread-safe FIFO Cache with optional TTL and eviction listeners.

Java · high confidence

New disk scheduling algorithm implementations added

Added five new disk scheduling algorithm implementations to the library: Shortest Seek First (SFF), SCAN, LOOK, Circular SCAN (C-SCAN), and Circular LOOK (C-LOOK). These classes provide specific logic for ordering disk I/O requests based on different strategies, such as minimizing seek time (SFF), sweeping across the disk (SCAN), or optimizing head movement by stopping at the last request in a direction (LOOK/C-LOOK).

src/main/java/com/thealgorithms/scheduling/diskscheduling · high confidence

New divide-and-conquer algorithms added

The divide-and-conquer package now includes several new algorithm implementations: BinaryExponentiation for efficient power calculation, CountingInversions to count array inversions using a merge-sort approach, MedianOfTwoSortedArrays to find the median of two sorted arrays in logarithmic time, SkylineAlgorithm for computing skyline profiles, StrassenMatrixMultiplication for optimized matrix multiplication, TilingProblem to tile a board with L-shaped tiles, and ClosestPair to find the nearest points in a coordinate system.

src/main/java/com/thealgorithms/divideandconquer · high confidence

New geometry algorithms for line drawing, convex hulls, and segment intersection

The geometry package now includes several new algorithms: line drawing via Bresenham's, DDA, and Xiaolin Wu's methods (the latter providing anti-aliased pixel intensities); convex hull computation using Graham Scan, a brute-force approach, and a recursive divide-and-conquer method; segment intersection detection via a utility class and the Bentley-Ottmann sweep-line algorithm; and shape generation using the Midpoint Circle and Midpoint Ellipse algorithms. A new Point record and Haversine distance calculator are also added to support these geometric operations.

src/main/java/com/thealgorithms/geometry · high confidence

New graph algorithms added: max flow, clique enumeration, and more

The graph package now includes several new algorithm implementations: Dinic's and Edmonds-Karp algorithms for maximum flow, Bron-Kerbosch for maximal clique enumeration, Hopcroft-Karp for bipartite matching, Hungarian algorithm for the assignment problem, Edmonds's algorithm for minimum spanning arborescence, Hierholzer's algorithm for Eulerian circuits and paths, a Gomory-Hu tree builder for all-pairs min-cuts, a Constrained Shortest Path solver, a Predecessor-Constrained DFS for DAG traversal, a DSU-based Account Merge utility, and a Traveling Salesman Problem solver.

src/main/java/com/thealgorithms/graph · high confidence

New graph algorithms and data structures added

This update introduces a suite of new graph algorithms and data structures to the library, including A\* pathfinding, Bellman-Ford (with negative cycle detection), bipartite graph checking via DFS, Boruvka's Minimum Spanning Tree, connected component counting, cycle detection, Dials' Algorithm for shortest paths, Dijkstra's shortest path, Edmonds' Blossom Algorithm for maximum matching, Floyd-Warshall all-pairs shortest paths, Ford-Fulkerson maximum flow, and Hamiltonian cycle finding. These additions expand the available graph processing capabilities for users.

src/main/java/com/thealgorithms/datastructures/graphs · high confidence

New greedy algorithm implementations added

The greedy algorithms package now includes several new algorithm implementations: ActivitySelection for selecting maximum non-overlapping activities, BandwidthAllocation for maximizing value from bandwidth distribution, BinaryAddition for adding binary strings, CoinChange for finding minimum coins using a greedy approach, DigitSeparation for splitting large numbers into digits, EgyptianFraction for representing fractions as sums of unit fractions, GaleShapley for stable matching, JobSequencing for maximizing job profits within deadlines, KCenters for minimizing maximum distance to centers, MergeIntervals for combining overlapping intervals, MinimizingLateness for scheduling jobs by deadline, MinimumWaitingTime for optimizing query processing order, OptimalFileMerging for minimizing merge costs using a priority queue, and StockProfitCalculator for finding maximum single-transaction profit.

src/main/java/com/thealgorithms/greedyalgorithms · high confidence

New hash map implementations and utility algorithms added

This location introduces several new data structure implementations and algorithmic utilities. It adds three distinct hash map classes: a generic hash map using an array of linked lists with separate chaining, a generic hash map using an ArrayList of linked lists, and a Cuckoo Hashing implementation that uses two hash functions and automatic resizing. Additionally, it includes a Linear Probing Hash Map that extends a new abstract Map base class, providing a consistent interface for put, get, delete, and keys operations. The change also adds utility classes for computing the multiset intersection of two integer arrays and finding majority elements in an array, both leveraging HashMaps for efficient counting.

src/main/java/com/thealgorithms/datastructures/hashmap/hashing · high confidence

New heap data structures and algorithms added

The \src/main/java/com/thealgorithms/datastructures/heaps\ package now includes several new heap implementations and algorithms: \FibonacciHeap\ for efficient merging and decrease-key operations, \GenericHeap\ for type-safe max-heap operations, \IndexedPriorityQueue\ for addressable priority queues with O(log n) updates, \LeftistHeap\ for efficient merging, and \MinPriorityQueue\ for fixed-capacity min-heaps. Additionally, new algorithm classes \KthElementFinder\, \MedianFinder\, and \MergeKSortedArrays\ leverage heap structures for efficient data processing. Supporting classes \Heap\, \HeapElement\, and \EmptyHeapException\ provide a common interface and element representation for these structures.

src/main/java/com/thealgorithms/datastructures/heaps · high confidence

New interfaces for array and matrix search algorithms

Added \SearchAlgorithm\ and \MatrixSearchAlgorithm\ interfaces in the \devutils.searches\ package to standardize how search algorithms are implemented. The \SearchAlgorithm\ interface defines a contract for searching within a single array, while \MatrixSearchAlgorithm\ provides a similar contract for searching within a 2D matrix, allowing developers to implement consistent search logic across different data structures.

src/main/java/com/thealgorithms/devutils/searches · high confidence

New linked list algorithms and data structures added

The \src/main/java/com/thealgorithms/datastructures/lists\ package now includes several new implementations and algorithms: \CircleLinkedList\ and \CircularDoublyLinkedList\ for circular list structures, \CursorLinkedList\ for an array-based linked list simulation, and \FlattenMultilevelLinkedList\ to merge multilevel lists. Additionally, new utility algorithms have been added for list manipulation and analysis, including \MergeKSortedLinkedList\ (using a min-heap), \MergeSortedSinglyLinkedList\, \ReverseKGroup\, \RotateSinglyLinkedLists\, \MiddleOfLinkedList\ (using the tortoise-and-hare technique), \PalindromeSinglyLinkedList\, \QuickSortLinkedList\, \CountSinglyLinkedListRecursion\, \CreateAndDetectLoop\ (cycle detection), and \RandomNode\ (random selection).

src/main/java/com/thealgorithms/datastructures/lists · high confidence

New machine learning algorithms added: Linear Regression, Perceptron, and Multinomial Naive Bayes

Three new machine learning models are now available in the \com.thealgorithms.machinelearning\ package. Users can perform linear regression using \LinearRegression\, which implements batch gradient descent to learn slope and intercept for continuous prediction. A binary \Perceptron\ classifier is included for single-layer neural network classification, supporting online updates and convergence tracking. Additionally, \MultinomialNaiveBayesClassifier\ provides text or count-based classification with Laplace smoothing and log-probability calculations to prevent numerical underflow.

src/main/java/com/thealgorithms/machinelearning · high confidence

New mathematical algorithms and utility classes added to the maths library

The maths package has been expanded with a wide range of new algorithms and utility classes. New capabilities include fraction arithmetic via ADTFraction, geometric area and volume calculations (Area, Volume), number theory checks (AbundantNumber, AmicableNumber, AutomorphicNumber, BellNumbers, CatalanNumbers, CollatzConjecture, ChineseRemainderTheorem, etc.), signal processing functions (AutoCorrelation, CircularConvolutionFFT, Convolution, ConvolutionFFT, Correlation), and numerical methods (ChebyshevIteration, BinaryPow, Ceil). Existing classes like AbsoluteMax, AbsoluteMin, and Average have been refactored into proper utility classes with improved input validation and documentation.

src/main/java/com/thealgorithms/maths · high confidence

New matrix algorithms and utilities added

The matrix package now includes several new linear algebra and utility classes: InverseOfMatrix for computing matrix inverses via Gaussian elimination, LUDecomposition and QRDecomposition (Gram-Schmidt) for matrix factorizations, SolveSystem for solving linear systems Ax=b, MatrixRank for computing matrix rank, StochasticMatrix for checking row/column stochasticity, MatrixMultiplication for general matrix multiplication, MatrixTranspose for transposing integer matrices, MirrorOfMatrix for mirroring matrices, MedianOfMatrix for finding the median of a matrix, PrintAMatrixInSpiralOrder for spiral traversal, RotateMatrixBy90Degrees for rotating square matrices, Fibonacci for computing Fibonacci numbers via matrix exponentiation, and MatrixUtil as a shared utility for validation and BigDecimal-based matrix operations.

src/main/java/com/thealgorithms/matrix · high confidence

New physics algorithms for electrostatics, gravitation, optics, and motion

The physics package now includes ten new utility classes for scientific calculations. Users can calculate electrostatic forces and orbital velocities with CoulombsLaw, and gravitational forces and orbital velocities with Gravitation. Optics capabilities are added via SnellLaw for refraction angles and ThinLens for image distance, magnification, and image type. Motion simulations are expanded with Kinematics for constant acceleration (SUVAT equations), ProjectileMotion and GroundToGroundProjectileMotion for trajectory analysis, and SimplePendulumRK4 for nonlinear pendulum simulation using the Runge-Kutta 4th order method. Additionally, DampedOscillator models mass-spring-damper systems with analytical and Euler integration methods, ElasticCollision2D handles 2D elastic collisions between circular bodies, and Relativity provides tools for length contraction, time dilation, and velocity addition.

src/main/java/com/thealgorithms/physics · high confidence

New prefix sum algorithm implementations added

The prefix sum package now includes five new algorithm classes: DifferenceArray for efficient range updates, PrefixSum and PrefixSum2D for O(1) range and sub-matrix sum queries, RangeSumQuery as a utility for 1D range sums, and SubarraySumEqualsK to count subarrays summing to a target value k using a HashMap.

src/main/java/com/thealgorithms/prefixsum · high confidence

The \src/main/java/com/thealgorithms/maths/Prime\ package now includes several new classes for number theory operations. Users can calculate the Liouville lambda function (\LiouvilleLambdaFunction\), the Möbius function (\MobiusFunction\), and check for square-free integers (\SquareFreeInteger\). Additionally, primality testing capabilities have been expanded with the Miller-Rabin probabilistic and deterministic tests (\MillerRabinPrimalityCheck\), a standard trial-division prime check (\PrimeCheck\), and a prime factorization utility (\PrimeFactorization\).

src/main/java/com/thealgorithms/maths/Prime · high confidence

New queue data structure implementations and algorithms

The queues package now includes several new implementations and algorithms: a generic CircularQueue using a wrapping array, a Deque (double-ended queue) based on a doubly linked list, a generic LinkedQueue with iterator support, a generic Queue using a circular array, a QueueByTwoStacks implementation, a generic ThreadSafeQueue with blocking capabilities for producer-consumer scenarios, and a TokenBucket rate limiter. Additionally, new utility algorithms have been added: SlidingWindowMaximum for efficiently finding max values in sliding windows using a deque, ReverseQueueRecursion for reversing a queue via recursion, and an enhanced PriorityQueues class using a max-heap. The package also features a GenericArrayListQueue backed by Java's ArrayList.

src/main/java/com/thealgorithms/datastructures/queues · high confidence

New recursive algorithms added to the recursion package

The recursion package now includes several new algorithm implementations: DiceThrower generates all dice roll combinations that sum to a target using recursive backtracking; FactorialRecursion computes factorials recursively with input validation; FibonacciSeries provides a naive recursive Fibonacci calculation with cross-references to other implementations; GenerateSubsets creates the power set of a string via recursion; and SylvesterSequence calculates terms of Sylvester's sequence using BigInteger for precision.

src/main/java/com/thealgorithms/recursion · high confidence

New search algorithms and interface implementations added

This update introduces several new search capabilities to the library. It adds the BM25 Inverted Index for relevance-scored text search, Boyer-Moore and KMP algorithms for efficient string pattern matching, and a 2D array binary search for sorted matrices. Additionally, it provides generic implementations of Binary Search, Iterative Binary Search, Exponential Search, Fibonacci Search, Interpolation Search, Jump Search, Lower Bound, and Ternary Search that adhere to the SearchAlgorithm interface, along with Breadth-First and Depth-First search for graph traversal.

src/main/java/com/thealgorithms/searches · high confidence

New sliding window algorithms added to the library

The sliding window package now includes several new algorithm implementations: counting distinct elements in a window, counting subarrays with exactly k odd numbers, finding the longest subarray with sum less than or equal to K, finding the longest substring without repeating characters, calculating maximum and minimum sums for fixed-size subarrays, finding the minimum window substring containing all characters of another string, and identifying the shortest coprime segment in an array.

src/main/java/com/thealgorithms/slidingwindow · high confidence

New stack data structure implementations and interface

The stacks module now provides a generic \Stack\<T\>\ interface and four distinct implementations: \StackArray\ (array-based with dynamic resizing), \StackArrayList\ (backed by \ArrayList\), \NodeStack\ (linked-node based), and \StackOfLinkedList\ (singly linked list). Additionally, a \ReverseStack\ utility class is introduced to reverse stack contents using recursion, and the module documentation has been updated to explain stack concepts and operations.

src/main/java/com/thealgorithms/datastructures/stacks · high confidence

New stack-based algorithms and data structures added

The \src/main/java/com/thealgorithms/stacks\ package has been expanded with a wide range of new implementations. This includes specialized stacks such as \MinStackUsingSingleStack\ and \MinStackUsingTwoStacks\ for O(1) minimum retrieval, \GreatestElementConstantTime\ for maximum retrieval, and \StackUsingTwoQueues\ for implementing a stack via queues. New algorithms cover expression handling (\InfixToPostfix\, \InfixToPrefix\, \PostfixToInfix\, \PrefixToInfix\, \PostfixEvaluator\, \PrefixEvaluator\), bracket validation (\BalancedBrackets\, \DuplicateBrackets\), and various array problems (\NextGreaterElement\, \NextSmallerElement\, \StockSpanProblem\, \LargestRectangle\, \MaximumMinimumWindow\, \CelebrityFinder\). Additional utilities include \DecimalToAnyUsingStack\ for base conversion, \SortStack\ for recursive sorting, and \PalindromeWithStack\ for string palindrome checking.

src/main/java/com/thealgorithms/stacks · high confidence

New streaming algorithms for change detection, filtering, and time-series analysis

Added a suite of new classes in the streaming package to support real-time data processing: Adwin for adaptive windowing, CusumDetector and EwmaChangeDetector for statistical change detection, ComplementaryFilter for sensor fusion, ExtendedKalmanFilter and UnscentedKalmanFilter for nonlinear state estimation, HampelFilter for robust outlier replacement, DynamicTimeWarping for time-series alignment, P2QuantileEstimator and TDigest for quantile estimation, WelfordAlgorithm for online statistics, and ExponentialMovingAverage for smoothed averages.

src/main/java/com/thealgorithms/streaming · high confidence

New string algorithms and utilities added to the strings package

This update introduces a comprehensive suite of new string processing capabilities to the \com.thealgorithms.strings\ package. Users can now perform multi-pattern matching with the Aho-Corasick algorithm, find the longest palindromic substring via Manacher's algorithm, and identify the longest common substring or repeated substring using optimized approaches. Additional features include checking for isomorphic strings, verifying isograms, and arranging characters from two strings alternately. The package also adds utilities for counting words and non-whitespace characters, checking if characters are in alphabetical order, and calculating Hamming distance. Several classic search algorithms are also included, such as KMP, Horspool, and Kasai's algorithm for LCP array construction.

src/main/java/com/thealgorithms/strings · high confidence

New tree data structures and algorithms added

The trees package now includes several new data structures and algorithms: AVL trees (AVLSimple and AVLTree), B-Trees, Binary Search Trees (iterative and recursive implementations), a generic recursive BST with pretty printing, a basic Binary Tree with parent pointers, Centroid Decomposition, and utility algorithms for boundary traversal, converting trees to strings, and finding ceiling values in BSTs.

src/main/java/com/thealgorithms/datastructures/trees · high confidence

Standardized development environment and code quality tooling

The repository now provides a fully automated, reproducible development setup via Gitpod, including a Dockerfile that installs the Java 21 SDK and clang-format-16 for consistent C-style formatting. To enforce code standards, Checkstyle and PMD configurations have been added to validate naming, imports, and structure, while a custom PMD rule flags redundant main methods. Additionally, SpotBugs and Infer static analysis tools are configured with exclusion lists to suppress known false positives, and a .clang-format file defines the project's formatting rules.

(repo-wide) · high confidence

Test coverage

1 commit adding/updating tests in src/test/java/com/thealgorithms/matrix/matrixexponentiation; 28 commits adding/updating tests in src/test/java/com/thealgorithms/scheduling; Added comprehensive unit tests for BloomFilter; Added test coverage for CRDT data structures; Added test coverage for FIFO, LIFO, LFU, LRU, MRU, and RR cache implementations; Added test coverage for HashMap implementations and algorithms; Added test coverage for K-Nearest Neighbors, Linear Regression, and Multinomial Naive Bayes classifiers; Added test coverage for Tower of Hanoi and Word Boggle algorithms; Added test coverage for greedy algorithms; Added test coverage for linked list algorithms and data structures; Added test coverage for miscellaneous algorithms; Added test coverage for multiple compression algorithms; Added test coverage for new streaming algorithms; Added test coverage for prefix sum algorithms; Added test coverage for prime number algorithms; Added test coverage for queue data structures and algorithms; Added test coverage for recursion algorithms; Added test coverage for sliding window algorithms; Added test coverage for various algorithms in the 'others' package; Added tests for EMAFilter and IIRFilter; Added unit tests for A5 cipher components; Added unit tests for BufferedReader; Added unit tests for CircularBuffer and SlidingWindowAggregator; Added unit tests for Cohen-Sutherland and Liang-Barsky line clipping algorithms; Added unit tests for Disjoint Set Union implementations; Added unit tests for DynamicArray; Added unit tests for ZigZagPattern encoding; Added unit tests for conversion algorithms; Added unit tests for disk scheduling algorithms; Added unit tests for divide-and-conquer algorithms; Added unit tests for graph algorithms; Added unit tests for heap data structures and algorithms; Added unit tests for mathematics algorithms; Added unit tests for multiple cipher implementations; Added unit tests for new physics algorithms; Added unit tests for randomized algorithms; Added unit tests for search algorithms; Added unit tests for stack data structure implementations; Added unit tests for stack-based algorithms; Added unit tests for string algorithms; Added unit tests for the Bag data structure; Added unit tests for the ProcessDetails entity; Added unit tests for tree data structures and algorithms; Expanded test coverage for bit manipulation algorithms; Expanded test coverage for dynamic programming algorithms; Expanded test coverage for sorting algorithms.

Dependencies

Initial Maven project configuration with Java 21 and modern tooling

The project is now built using Maven with a \pom.xml\ that sets the Java compiler source and target to version 21. It manages dependencies via the JUnit 6.1.3 BOM and explicitly includes AssertJ 3.27.7, Mockito 5.23.0, Commons Lang3 3.20.0, and Commons Collections4 4.6.0. The build lifecycle integrates JaCoCo 0.8.15 for code coverage, Checkstyle 14.1.0 for style checking, SpotBugs 4.10.4.1 (with fb-contrib 7.7.4 and findsecbugs 1.14.0) for static analysis, and PMD 3.28.0 with security rulesets.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 64 → 67 (+3.8)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 60 → 60 (+0.0)
  • Architecture 88 → 100 (+12.3)
  • Maturity 58 → 72 (+14.4)
  • Readiness 67 → 67 (-0.0)
  • Security 88 → 83 (-4.8)

Resolved (21)

  • Duplicated block (11 lines × 2) (src/main/java/com/thealgorithms/conversions/RgbHsvConversion.java)
  • Duplicated block (11 lines × 2) (src/main/java/com/thealgorithms/others/Damm.java)
  • Duplicated block (13 lines × 2) (src/main/java/com/thealgorithms/ciphers/AES.java)
  • Duplicated block (23 lines × 2) (src/main/java/com/thealgorithms/datastructures/trees/BSTRecursiveGeneric.java)
  • Duplicated block (6 lines × 2) (src/main/java/com/thealgorithms/streaming/CusumDetector.java)
  • Duplicated block (7 lines × 2) (src/main/java/com/thealgorithms/streaming/CusumDetector.java)
  • Duplicated block (8 lines × 2) (src/main/java/com/thealgorithms/ciphers/PlayfairCipher.java)
  • Duplicated block (9–11 lines × 3) (src/main/java/com/thealgorithms/machinelearning/KNearestNeighbors.java)
  • Edited copy of a member (23 corresponding lines) (src/main/java/com/thealgorithms/ciphers/PlayfairCipher.java)
  • Low cohesion: Builder (LCOM4 4) (src/main/java/com/thealgorithms/datastructures/caches/RRCache.java)
  • Off-boarding risk: anonymized user #1
  • Off-boarding risk: anonymized user #2
  • Off-boarding risk: anonymized user #3
  • Off-boarding risk: anonymized user #4
  • Orphaned file (src/main/java/com/thealgorithms/backtracking/MazeRecursion.java)
  • Orphaned file (src/main/java/com/thealgorithms/datastructures/lists/SkipList.java)
  • Orphaned file (src/main/java/com/thealgorithms/searches/BinarySearch2dArray.java)
  • Orphaned file (src/main/java/com/thealgorithms/searches/RabinKarpAlgorithm.java)
  • Orphaned file (src/main/java/com/thealgorithms/sorts/TreeSort.java)
  • Orphaned file (src/main/java/com/thealgorithms/strings/HorspoolSearch.java)
  • …and 1 more

New (174)

  • Duplicated block (7 lines × 2) (src/main/java/com/thealgorithms/backtracking/MazeRecursion.java)
  • Edited copies of one member (3 members, 10+ corresponding lines) (src/main/java/com/thealgorithms/divideandconquer/StrassenMatrixMultiplication.java)
  • Edited copies of one member (3 members, 11+ corresponding lines) (src/main/java/com/thealgorithms/bitmanipulation/BcdConversion.java)
  • Edited copies of one member (3 members, 12+ corresponding lines) (src/main/java/com/thealgorithms/datastructures/lists/MiddleOfLinkedList.java)
  • Edited copies of one member (3 members, 13+ corresponding lines) (src/main/java/com/thealgorithms/datastructures/lists/TortoiseHareAlgo.java)
  • Edited copies of one member (3 members, 16+ corresponding lines) (src/main/java/com/thealgorithms/sorts/AdaptiveMergeSort.java)
  • Edited copies of one member (3 members, 17+ corresponding lines) (src/main/java/com/thealgorithms/searches/BinarySearch.java)
  • Edited copies of one member (3 members, 17+ corresponding lines) (src/main/java/com/thealgorithms/stacks/NextGreaterElement.java)
  • Edited copies of one member (3 members, 24+ corresponding lines) (src/main/java/com/thealgorithms/datastructures/caches/FIFOCache.java)
  • Edited copies of one member (3 members, 30+ corresponding lines) (src/main/java/com/thealgorithms/dynamicprogramming/RegexMatching.java)
  • Edited copies of one member (3 members, 7+ corresponding lines) (src/main/java/com/thealgorithms/ciphers/ColumnarTranspositionCipher.java)
  • Edited copies of one member (3 members, 7+ corresponding lines) (src/main/java/com/thealgorithms/machinelearning/KNearestNeighbors.java)
  • Edited copies of one member (3 members, 7+ corresponding lines) (src/main/java/com/thealgorithms/maths/ChebyshevIteration.java)
  • Edited copies of one member (3 members, 7+ corresponding lines) (src/main/java/com/thealgorithms/matrix/QRDecomposition.java)
  • Edited copies of one member (3 members, 7+ corresponding lines) (src/main/java/com/thealgorithms/sorts/BucketSort.java)
  • Edited copies of one member (3 members, 9+ corresponding lines) (src/main/java/com/thealgorithms/conversions/HexToOct.java)
  • Edited copies of one member (3 members, 9+ corresponding lines) (src/main/java/com/thealgorithms/maths/Area.java)
  • Edited copies of one member (4 members, 11+ corresponding lines) (src/main/java/com/thealgorithms/sorts/FlashSort.java)
  • Edited copies of one member (4 members, 13+ corresponding lines) (src/main/java/com/thealgorithms/datastructures/trees/Trie.java)
  • Edited copies of one member (4 members, 14+ corresponding lines) (src/main/java/com/thealgorithms/maths/AliquotSum.java)
  • …and 154 more

Changes since last survey

  • 32 commits — 15 feature/other, 17 fixes

By area

  • src/main — 21 commits
  • .github/workflows — 6 commits
  • (root) — 4 commits
  • src/test — 1 commit

Notable commits

  • fix: To Fix maze recursion boundary validation with code improvements (#7672)
  • fix: fix(conversions): reject non-hex digits in HexToOct.hexToDecimal (#7748)
  • fix: fix(dynamicprogramming): handle n=0 and negative inputs safely in CatalanNumber (#7731)
  • fix: fix(lists): leave SkipList size unchanged when removing a missing element (#7666)
  • fix: fix(maths): correct coordinate subtraction in DistanceFormula.euclideanDistance (#7747)
  • fix: fix(maths): prevent infinite recursion on negative inputs in BinomialCoefficient (#7730)
  • fix: fix(maths): prevent intermediate integer overflow in CatalanNumbers (#7732)
  • fix: fix(searches): add null safety and Comparable consistency to JumpSearch (#7653)
  • fix: fix(searches): add null safety and empty matrix handling to RowColumnWiseSorted2dArrayBinarySearch (#7725)
  • fix: fix(searches): avoid int overflow and short-text crash in RabinKarpAlgorithm (#7665)
  • fix: fix(searches): fix out-of-bounds in single-row and single-column in BinarySearch2dArray (#7724)
  • fix: fix(searches): support characters outside extended ASCII in BoyerMoore (#7664)
  • fix: fix(searches): support rectangular matrices and null safety in SearchInARowAndColWiseSortedMatrix (#7655)
  • fix: fix(sorts): handle small arrays in FlashSort and empty arrays in DutchNationalFlagSort (#7662)
  • fix: fix(sorts): keep duplicate values in TreeSort (#7661)
  • fix: fix(sorts): stop SwapSort looping forever on duplicate values (#7660)
  • fix: fix(strings): use case-insensitive shift table in HorspoolSearch.findFirstInsensitive (#7663)
  • change: Add Booth's algorithm for minimal string rotation (#7644)
  • change: Add ChaCha20 stream cipher (#7754)
  • change: Improve Javadoc for LinearSearch find method (#7657)
  • …and 12 more

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

TheAlgorithms/Java was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 2f04e814eeb7fcf1af1c680ac29934bbb4fb23b1 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-f3449e6eb431.