ErrLookup › trekhleb/javascript-algorithms

trekhleb/javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings · JavaScript · 182 source files

Analyzed at 85293e3e2b on 2026-08-24. 31 documented errors.

Code / MessageTypeSeverityTags
Matrices have different dimensions
exception error matrix, shape-validation, math, rank-mismatch
You have to implement heap pair comparison method for
exception error heap, abstract-method, subclassing, priority-queue, data-structures
sort method must be implemented
exception error sorting, abstract-method, inheritance, oop
One or two values are not in sets
exception error disjoint-set, union-find, precondition, make-set, kruskal
Matrices have different shapes
exception error matrix, shape-validation, math, off-by-one
Matrices have incompatible shape for multiplication
exception error matrix, multiplication, linear-algebra, dimension-mismatch, math
Left index can not be greater than right one
exception error fenwick-tree, binary-indexed-tree, argument-validation, range-query, data-structures
Edge has already been added before
exception error graph, duplicate-edge, unique-key, multigraph, add-edge
Items and weights must be of the same size
exception error statistics, random-sampling, array-length-mismatch, validation
Cannot construct Heap instance directly
exception error heap, abstract-class, instantiation, typeerror, priority-queue
Strings must be of the same length
exception error string, hamming-distance, length-mismatch, validation
The data is empty
exception error machine-learning, k-means, clustering, null-check, validation
The method supports only positive integers
exception error math, square-root, domain-error, validation
Either dataSet or labels or toClassify were not set
exception error machine-learning, knn, classification, missing-argument, validation
Position is out of allowed range
exception error fenwick-tree, binary-indexed-tree, index-out-of-range, off-by-one, data-structures
Can't remove . Remove method is not implemented yet
exception error red-black-tree, not-implemented, remove, data-structures, balanced-tree
Edge not found in graph
exception error graph, delete-edge, precondition, idempotency
Item not found in the tree
exception error binary-search-tree, remove, item-not-found, data-structures
Vertex has already been added before
exception error graph, duplicate-vertex, unique-key, add-vertex
Items must not be empty
exception error statistics, random-sampling, empty-array, validation
Graph vertex must have a value
exception error graph, vertex, constructor, undefined-argument
Invalid key string length. The square root of the key…
exception error
Invalid key string length. The key length must be a square…
exception error
Can't handle position smaller than 1 or greater than
exception error
Kruskal's algorithms works only for undirected graphs
exception error
The message and key string can only contain letters
exception error
Eulerian path must contain two odd-ranked vertices
exception error
Prim's algorithms works only for undirected graphs
exception error
This method is not implemented yet
exception error
Matrix is not of 2D shape
exception error
Invalid matrix format
exception error