ErrLookup › TheAlgorithms/Java

TheAlgorithms/Java

All Algorithms implemented in Java · Java · 819 source files

Analyzed at fdfb9a395b on 2026-08-13. 448 documented errors.

Code / MessageTypeSeverityTags
cache cannot be empty!
exception error lru-cache, concurrency, thread-safety, data-structures
Tolerance must be positive.
validation error validation, numerical-methods, linear-algebra, precondition
Start must be non-negative. Given start:
exception error math, kaprekar, range, argument-validation, non-negative
For odd Arrays if the median appears ceil(n/2) times, the…
exception error sorting, wiggle-sort, median, validation, illegalargument
No more than half the number of values may be the same.
exception error sorting, wiggle-sort, duplicates, validation, illegalargument
Index must be non-negative
validation error combinatorics, input-validation, catalan-numbers, java
persistence must be in (0, 1]
validation error java, parameter-validation, procedural-generation, noise, illegal-argument
Base must be greater than 01
validation error geometry, input-validation, area, java, string-concatenation-bug
Array must be non-empty.
validation error math, array, recursion, divide-and-conquer, empty-collection, argument-validation
Empty or already closed stream provided
exception error io, stream, constructor, closed-stream, buffered-reader
No valid prime sum found.
exception critical math, goldbach, prime, illegal-state, defensive-guard, unreachable
This is a utility class and cannot be instantiated.
validation error utility-class, reflection, instantiation, java, design-pattern
Input 'n' is too big to give accurate result.
validation error math, fibonacci, floating-point, argument-validation
Matrix was found to be singular
exception error matrix, singular, linear-algebra, gaussian-elimination, numerical
Input must be a positive integer. Received
validation error math, harshad, number-theory, argument-validation, positive-integer
features and labels must be non-empty and of equal length
validation error machine-learning, validation, empty-input, argument-mismatch, naive-bayes
Item not found in the heap
exception error heap, membership, priority-update, generic-heap
Negative exponent is not supported.
validation error arithmetic, number-theory, modular-arithmetic, cryptographic, unsupported-operation
This graph contains a cycle. No linear ordering is…
exception error topological-sort, graph, cycle-detection, dfs, runtime-exception
Input cannot be negative
validation error bit-manipulation, java, validation, illegalargumentexception
aCoeffs must be of size
validation error audio, filter, argument-validation, illegalargumentexception, off-by-one
Radius (r) must be non-negative.
validation error conversions, coordinate, polar, validation, java
array must be non-empty.
validation error math, array, recursion, divide-and-conquer, empty-collection, argument-validation
Velocity, height, and gravity must be non-negative, and…
validation error java, physics, parameter-validation, projectile-motion, illegal-argument
The input matrix cannot be null
exception error matrix, null-check, precondition, linear-algebra
Table is empty; cannot find keys.
exception error hashmap, cuckoo-hashing, precondition, validation
Input must be non-negative!
validation error math, jacobsthal, sequence, argument-validation, non-negative
Matrix is rank deficient. Cannot perform QR decomposition.
exception error matrix, linear-algebra, qr-decomposition, rank-deficient, gram-schmidt
Cannot convert NaN to long!
exception warning math, nan, swallowed-exception, builder, code-smell
Minimum number of buckets must be between 1 and 100
exception error sorting, bucket-sort, constructor, validation, illegalargument
adjacencyList size must equal vertexCount
validation error graph, validation, argument-mismatch, tarjan, adjacency-list
Input matrices must not be empty
exception error matrix, linear-algebra, empty-check, argument-validation
Input 'n' must be a non-negative integer.
validation error validation, sequences, precondition, numerical-methods
GCD cannot be found.
exception error math, factorization, algorithm-failure, prime-input
Huffman tree is empty.
exception error compression, huffman, validation, illegal-state
Smallest eigenvalue must be positive (matrix must be…
validation error linear-algebra, input-validation, eigenvalues, positive-definite, chebyshev-iteration, java
Year must be between 46 and 8499.
exception error date, zellers-congruence, range-validation, argument-validation
xEnd should be greater than xStart
validation error validation, numerical-methods, ode, precondition
Not a valid IPv6-mapped IPv4 address.
validation error network, ipv4, ipv6, input-validation
Alpha must be between 0 and 1.
validation error audio, filter, constructor, argument-validation, illegalargumentexception
Number must be even and greater than 2.
validation error math, goldbach, prime, argument-validation, parity
Sample size cannot exceed stream size.
exception error randomized, input-validation, illegal-argument, reservoir-sampling, sampling
Total internal reflection: no refraction possible.
exception warning java, physics, optics, snells-law, total-internal-reflection, illegal-argument
Matrix must not be null or empty
exception error matrix, null-check, precondition, stochastic, markov
Natural frequency must be positive.
validation error java, physics, parameter-validation, oscillator, constructor, illegal-argument
Orbiting mass and radius must be positive.
validation error java, physics, parameter-validation, orbital-mechanics, illegal-argument
Invalid number of vertices or root
validation error graph-algorithm, argument-validation, index-bounds, minimum-spanning-arborescence
Invalid range indices
exception error prefix-sum, input-validation, illegal-argument, off-by-one, api-inconsistency
Input string must be a valid integer
validation error math, harshad, string-parsing, number-format, argument-validation
Array contains non-positive integers.
exception error sorting, non-negative-domain, input-validation, misleading-message
Number must be non-negative.
exception error math, validation, illegal-argument, number-theory
Numbers array cannot be empty or null
validation error validation, varargs, maths, precondition, illegal-argument
Must be a natural number
validation error validation, number-theory, precondition, domain-error
UNEXPECTED_WORD
Invalid Input. Unexpected Word
validation error java, words-to-number, grammar, unexpected-word
Input must be a positive integer.
validation error validation, number-theory, precondition, domain-error
Input must contain only '0' and '1'.
validation error bit-manipulation, java, validation, string, null-safety, illegalargumentexception
Symbol ' ' not found in the initial alphabet.
exception error compression, move-to-front, alphabet, validation, java
Cache cannot be empty!
exception error mru-cache, concurrency, thread-safety, data-structures
Input must me positive.
validation error validation, number-theory, precondition, domain-error
Invalid input: 0 ≤ k ≤ n is required.
validation error backtracking, combinatorics, argument-validation, illegalargumentexception
Mass and radius must be positive.
validation error java, physics, parameter-validation, orbital-mechanics, gravity, illegal-argument
n can't be smaller than k
validation error validation, combinatorics, argument-order, precondition
Number must be zero for random assignment!
exception error math, builder, runtime-exception, state-validation
Damping coefficient must be non-negative.
validation error java, physics, parameter-validation, oscillator, constructor, illegal-argument
State must be a non-null array of length 2.
validation error java, physics, parameter-validation, numerical-integration, state-vector, illegal-argument
Arguments must not be null
validation error bit-manipulation, gcd, null-check, biginteger, nullpointerexception
Array should contain an even number of elements
exception error math, bit-manipulation, invalid-argument, array-length
Input list cannot be null
exception error heap, min-heap, null-check, constructor
Speed must be lower than the speed of light
validation error java, physics, relativity, parameter-validation, unit-mismatch, illegal-argument
Start must be less than or equal to end. Given start
validation error math, kaprekar, range, argument-validation
Incorrect binary digit
validation error conversions, binary, validation, java
Number must be non-negative. Given:
exception error math, validation, illegal-argument, number-theory
Speed must not exceed the speed of light
validation error java, physics, relativity, parameter-validation, unit-mismatch, illegal-argument
Date separator must be '-' or '/'.
exception error date, zellers-congruence, format-validation, delimiter
Modulus must be positive.
validation error validation, number-theory, modular-arithmetic, cryptographic, precondition
n must be positive and odd.
validation error validation, number-theory, cryptographic, precondition
Input '" + input + "' contains not only digits
validation error java, input-validation, checksum, verhoeff, regex, illegal-argument
Out of range, available
exception error io, stream, peek, eof, buffered-reader, bounds-check
Unknown Roman symbol
validation error roman-numerals, input-validation
Invalid complex number format
validation error validation, parsing, complex-numbers, regex, input-format
Negative numbers are not allowed.
validation error validation, number-theory, bit-manipulation, precondition
Absolute value of Long.MIN_VALUE does not fit into signed…
exception error bit-manipulation, gcd, overflow, arithmeticexception, long-min-value
Matrix A must be square.
validation error linear-algebra, input-validation, matrix, square-matrix, chebyshev-iteration, java
Bad compressed k
exception error compression, lzw, corruption, validation, illegal-argument
Input index cannot be null or negative!
validation error validation, null-safety, sequences, precondition
Invalid unit ' '. Supported units are
validation error java, time-conversion, input-validation, illegalargument
Input ' ' contains not only digits
exception error checksum, validation, damm, input-validation, string
Stack is empty
exception error stacks, empty-stack, validation, nosuchelement, underflow
The number must be in the range
exception error math, roman-numerals, input-validation, argument-validation
Triangle cannot be formed with the given side lengths…
validation error math, geometry, herons-formula, triangle-inequality, argument-validation
Cannot pop from an empty stack.
exception error stack, empty-state, java, datastructures
Classification ratio must be between 0 and 1 (exclusive).
exception error sorting, config, range-validation, constructor
Invalid input: arrays must be non-empty and capacity/n…
validation error knapsack, negative-input, input-validation, java
Source and sink must be valid vertex indices
validation error graph-algorithm, argument-validation, index-bounds, max-flow
Capacity must be greater than zero.
validation error java, lfu-cache, capacity, argument-validation, cache
Default TTL must be >= 0
validation error java, fifo-cache, builder, ttl, argument-validation, cache
Input arrays are not sorted
validation error median, sorted-arrays, precondition, divide-and-conquer, java
Max eigenvalue must be strictly greater than min eigenvalue.
validation error linear-algebra, input-validation, eigenvalues, argument-order, chebyshev-iteration, java
Cannot peek , maximum upto (Buffer Limit)
exception error io, stream, peek, buffer-limit, buffered-reader, illegal-access-error
Graph contains a negative weight cycle
exception error graph, shortest-path, algorithm-invariant, negative-cycle