keon/algorithms
66.0
Adequate · 18 September 2026
43.7k
lines of production code
Python
primary language
1
measurement over time
What this system is
This system is a Python library providing a comprehensive collection of algorithmic solutions and data structure implementations. It organizes capabilities into distinct modules covering sorting, searching, graph theory, dynamic programming, compression, and various mathematical operations. The package exposes a typed public API for importing these reusable components, supported by extensive unit tests to ensure correctness.
How it got here
2016 — Python package restructuring and cleanup
10 changes.
The repository was reorganized into a formal Python package with standard governance files, while numerous legacy standalone scripts and incomplete implementations for data structures like stacks, queues, and graphs were removed. This cleanup was accompanied by the addition of comprehensive unit tests to ensure the correctness of the remaining core algorithms and data structures.
2018 — comprehensive algorithm module expansion
8 changes.
This period focused on significantly expanding the algorithms library by introducing new modules for graphs, heaps, maps, matrices, sets, stacks, and trees. The work involved implementing a wide variety of core algorithmic solutions and data structures while simultaneously establishing a clean public API and adding static type hints for better usability.
2019–2026 — Initial library structure and algorithm implementation
12 changes.
This period established the project's foundational structure by introducing a comprehensive suite of algorithm implementations across diverse categories such as sorting, searching, data structures, and dynamic programming. It involved organizing these modules into a coherent package hierarchy while setting up the initial project configuration and dependency management.
Features
Add LZW, Huffman, RLE, and Elias compression algorithms
The compression module now exposes four new lossless data compression algorithms: Lempel-Ziv-Welch (LZW), Huffman coding, Run-Length Encoding (RLE), and Elias Gamma/Delta coding. Users can import \lzw\_encode\ and \lzw\_decode\ for dictionary-based string compression, \HuffmanCoding\ for frequency-based encoding with file I/O support, \encode\_rle\ and \decode\_rle\ for simple repeated-character compression, and \elias\_gamma\ and \elias\delta\ for encoding positive integers. These implementations are centralized in the \algorithms/compression\ package and exported via \\\init\\_.py\.
algorithms/compression · high confidence
Add Misra-Gries and 1-Sparse Recovery streaming algorithms
The algorithms/streaming module now exposes two new streaming algorithms: Misra-Gries for frequency estimation (finding items appearing at least n/k times) and 1-Sparse Recovery for identifying a unique element in a dynamic stream of signed values. These are available via the \misras\_gries\ and \one\_sparse\ functions respectively.
algorithms/streaming · high confidence
Add heap-based algorithm implementations
The algorithms/heap module now exposes several new algorithmic capabilities: finding the k closest points to an origin, merging k sorted linked lists, computing a skyline contour from building dimensions, and determining the maximum value in a sliding window. These implementations are exported via the package's \_\init\\_.py, making them directly importable from algorithms.heap.
algorithms/heap · high confidence
Add set algorithms: keyboard row filter, randomized set, and set cover
The \algorithms/set\ module now exposes three new capabilities: a \find\_keyboard\_row\ function that filters words typable on a single QWERTY row, a \RandomizedSet\ class supporting O(1) insert, remove, and random element retrieval, and \greedy\_set\_cover\ and \optimal\_set\_cover\ functions for solving the set cover problem with approximate and exact strategies respectively.
algorithms/set · high confidence
Added Gale-Shapley and Kadane's algorithms to the greedy module
The \algorithms/greedy\ package now exposes two new algorithm implementations: the Gale-Shapley stable matching algorithm, which finds stable pairings based on ranked preferences, and Kadane's algorithm for finding the maximum contiguous subsequence sum in an array of integers. Both functions are exported via the module's \\_\init\\_.py\ for direct import.
algorithms/greedy · high confidence
Introduce tree algorithms module with comprehensive binary tree operations
The \algorithms/tree\ package has been added, providing a centralized collection of binary tree algorithms. This includes utilities for traversals (inorder, path sums), structural checks (balanced, symmetric, subtree, BST validation), views (left, right, top, bottom), and specific operations like finding the lowest common ancestor, inverting the tree, and converting trees to lists. The module also introduces new algorithms for constructing trees from preorder/postorder traversals, finding the deepest left leaf, and calculating maximum/minimum path sums, all exposed via a unified \\_\init\\_.py\ interface.
algorithms/tree · high confidence
Introduces public API and type hints for the algorithms package
The algorithms package now exposes a clean public API, allowing users to import core types like TreeNode, ListNode, and Graph directly from the top-level namespace, alongside the data\_structures submodule. Additionally, the package is now marked as typed via the addition of py.typed, enabling static type checkers to provide type checking for code using this library.
algorithms · high confidence
New algorithms/data\_structures package with core data structure implementations
A new \algorithms/data\_structures\ package has been introduced, consolidating core data structure implementations into a single, organized location. This package provides reusable classes for various data structures including trees (AVL, B, Binary Search, Red-Black, Fenwick, Segment, KD-tree), graphs (DirectedGraph, DirectedEdge, Node), hash tables (HashTable, ResizableHashTable, SeparateChainingHashTable), heaps (BinaryHeap), queues (ArrayQueue, LinkedListQueue), stacks, linked lists, priority queues, tries, and union-find. These implementations are now accessible via the \algorithms.data\_structures\ module, offering a centralized hub for fundamental data structures used throughout the library.
_algorithms/data\structures · high confidence
New algorithms/string package with string-processing algorithms
Added a new \algorithms/string\ package containing a comprehensive suite of string algorithms, including palindrome checks, cipher implementations (Caesar, Atbash), text processing (longest common prefix, anagram grouping, word segmentation), and search algorithms (KMP, Rabin-Karp, Z-algorithm). The package exposes these utilities via a central \\_\init\\_.py\ for easy import.
algorithms/string · high confidence
New array and bit manipulation algorithm modules
The repository now includes dedicated \algorithms.array\ and \algorithms.bit\_manipulation\ modules, exposing a suite of new community-contributed algorithms. The array module provides utilities for common data structures and problems, including \delete\_nth\, \flatten\, \garage\ (parking rearrangement), \josephus\, \limit\, \longest\_non\_repeat\, \max\_ones\_index\, \merge\_intervals\, \missing\_ranges\, \move\_zeros\, \n\_sum\, \plus\_one\, \remove\_duplicates\, \rotate\, \summarize\_ranges\, \three\_sum\, \top\_1\, \trimmean\, and \two\_sum\. The bit manipulation module adds low-level operations such as \add\_bitwise\_operator\, \binary\_gap\, \bit\_operation\ (get/set/clear/update), \bytes\_int\_conversion\, \count\_flips\_to\_convert\, \count\_ones\, \find\_difference\, \find\_missing\_number\, \flip\_bit\_longest\_seq\, \gray\_code\, \has\_alternative\_bit\, \insert\_bit\, \is\_power\_of\_two\, \remove\_bit\, \reverse\_bits\, \single\_number\ variants, \subsets\, and \swap\_pair\.
_algorithms/bit\manipulation · high confidence
New dynamic programming algorithm implementations added
The \algorithms/dynamic\_programming\ module now includes a comprehensive collection of dynamic programming solutions. This update adds implementations for classic problems including the Travelling Salesman Problem (bitmask DP), Best Time to Buy and Sell Stock, Climbing Stairs, Coin Change, Combination Sum, Edit Distance, Egg Drop, Fibonacci, House Robber, Knapsack, Longest Common Subsequence, Longest Increasing Subsequence, Matrix Chain Order, Maximum Subarray, Minimum Cost Path, Regular Expression Matching, Rod Cutting, and Word Break, among others. These new algorithms provide users with optimized, tested solutions for a wide range of computational challenges.
_algorithms/backtracking, algorithms/dynamic\programming · high confidence
New graph algorithms and data structures added
The algorithms/graph module now includes a comprehensive suite of new graph algorithms and supporting data structures. Users can now perform A\* search, compute all-pairs shortest paths (Floyd-Warshall), and find single-source shortest paths with Bellman-Ford (including negative cycle detection and path reconstruction). Additional capabilities include maximum matching (Edmonds' blossom algorithm), bipartite graph checking, graph cloning (BFS/DFS), connected component counting (BFS/DFS/Union-Find), cycle detection, clique finding (Bron-Kerbosch), topological sorting (Kahn's algorithm), and maximum flow computation (Ford-Fulkerson, Edmonds-Karp, Dinic's, BFS/DFS variants). The module also exports core graph data structures (DirectedGraph, Node, DirectedEdge) and utilities for Markov chains, factor combinations, and maze solving.
algorithms/graph · high confidence
New linked list and math algorithm implementations
This release adds a comprehensive suite of linked list algorithms—including operations for adding numbers, copying lists with random pointers, cycle detection, palindrome checking, merging, partitioning, and rotation—alongside new mathematical functions such as Chebyshev distance, geometric mean, base conversion, and Chinese Remainder Theorem solvers. These new capabilities are exposed via the \algorithms.linked\_list\ and \algorithms.math\ package interfaces for direct user access.
algorithms/math · high confidence
New map-based algorithm implementations and data structures
The algorithms/map module now provides a collection of new algorithmic utilities and data structures. This includes string analysis functions such as is\_anagram, is\_isomorphic, longest\_common\_substring, longest\_palindromic\_subsequence, and word\_pattern, alongside a valid\_sudoku checker. Additionally, the module introduces a RandomizedSet class for O(1) insert, remove, and random access operations, and exposes HashTable, ResizableHashTable, and SeparateChainingHashTable from the data\_structures package.
algorithms/map · high confidence
New matrix algorithms and operations added
The algorithms/matrix module now exposes a comprehensive suite of matrix operations, including multiplication, inversion, exponentiation, and decompositions (Cholesky and Crout). Additional capabilities include diagonal sorting, sparse matrix/vector multiplication, spiral traversal, image rotation, path counting, and Sudoku validation, all accessible via the package's public API.
algorithms/matrix · high confidence
New queue-based algorithm implementations
Added new algorithm implementations in the \algorithms/queue\ module, including \max\_sliding\_window\ for finding maximums in a sliding window using a monotonic deque, \MovingAverage\ for calculating averages from a data stream, \reconstruct\_queue\ for reordering people by height and position, and \ZigZagIterator\ for interleaving two lists. These utilities are now exported via the \algorithms.queue\ package.
algorithms/queue · high confidence
New searching algorithms module with multiple search strategies
The repository now includes a dedicated \algorithms/searching\ package that consolidates various search implementations. Users can access standard algorithms like binary, linear, jump, interpolation, and ternary search, as well as specialized variants such as exponential search, sentinel search, and searches for rotated arrays. The module also provides utilities for finding first/last occurrences, search insert positions, and range searches, alongside multiple approaches for the Two Sum problem (binary search, hash table, and two pointers).
algorithms/searching · high confidence
New stack-based algorithms and shared data structures
This release introduces a new \algorithms/stack\ module containing implementations for stack-based problems, including checking for consecutive integers, sorted order, and valid parentheses, as well as operations like simplifying Unix paths, finding the longest absolute file path, removing minimums, stuttering values, and switching pairs. It also adds a new \algorithms/common\ package that defines shared data types (\TreeNode\, \ListNode\, \Graph\) to enable composition across different algorithm categories.
algorithms/stack · high confidence
Removals
Removal of built-in sequence demonstration scripts
The built-in demonstration scripts for list, set, and tuple operations have been removed from the codebase. Specifically, the tuple.py file, which illustrated the immutability of tuples versus the mutability of lists through an append example, is no longer available. Users will no longer have access to these specific educational examples for understanding basic sequence behavior.
builtins · high confidence
Removal of legacy HashTable implementation
The legacy HashTable class, which implemented a map abstract data type using linear probing for collision resolution, has been removed from the codebase. This deletion eliminates the previously incomplete implementation where the get method was a stub and the put method contained logic for handling key replacement and probing.
hashtable · high confidence
Removal of legacy graph algorithms and modules
The \graph\ module has been cleaned up by removing several legacy files: \find\_path.py\ (containing pathfinding functions), \graph.py\ (an empty Graph class stub), and \traversal.py\ (containing DFS and BFS traversal implementations). These changes remove previously available graph traversal and pathfinding capabilities from the codebase.
graph · high confidence
Removal of legacy tree algorithm implementations
The \tree\ module has removed several standalone Python scripts and classes, including \deepest\_left.py\, \invert\_tree.py\, \max\_height.py\, \same\_tree.py\, \tree.py\, and \trie.py\. This cleanup eliminates specific binary tree operations (finding the deepest left child, inverting trees, calculating max height, comparing trees) and a word dictionary trie implementation, likely as part of a broader refactoring or standardization of the codebase's data structure examples.
tree · high confidence
Removal of linked list and binary search implementations
The \linkedlist\ module containing \DoublyLinkedList\ and \SinglyLinkedList\ classes has been removed, along with several search utilities in the \search\ directory: \binarySearch.py\, \countElem.py\, \firstOccurance.py\, and \lastOccurance.py\. These files, which provided basic data structure implementations and binary search algorithms for finding elements and counting occurrences, are no longer available in the codebase.
linkedlist, search · high confidence
Removal of string/reverseWords.py module
The file string/reverseWords.py, which contained the reverse and reverseWords functions for manipulating string arrays, has been removed from the codebase.
string · high confidence
Removed legacy stack implementation files
The \stack/\_\init\\_.py\ and \stack/stack.py\ files have been deleted from the repository. This removes the previous implementation of the Stack Abstract Data Type, including the \AbstractStack\ base class, \ArrayStack\, and \LinkedListStack\ classes, along with their associated methods like \push\, \pop\, \peek\, and \isEmpty\.
stack · high confidence
Removed queue module implementation
The queue module, including the \queue.py\ implementation file and its \\_\init\\_.py\ entry point, has been removed from the codebase. This eliminates the previously available queue data structures (ArrayQueue, LinkedListQueue, and HeapPriorityQueue) and their associated enqueue/dequeue behaviors.
queue · high confidence
Behavioural changes
Repository restructured into a Python package with new project governance files
The repository has been reorganized into a formal Python package named 'algorithms', introducing a structured directory layout (e.g., algorithms/graph, algorithms/sorting) and a MANIFEST.in file for packaging. To support this transition, several legacy standalone scripts (longestAbsPath.py, reverseString.py, sorting.py, testStack.py) and a tutorial text file (matrix\_rotation.txt) have been removed. The project now includes standard governance and configuration files: a .gitignore for Python artifacts, a LICENSE (MIT), a CODE\_OF\_CONDUCT.md, and an updated CONTRIBUTING.md. The README.md has been rewritten to provide installation instructions via pip, usage examples for the new package structure, and a comprehensive list of available data structures and algorithms.
(repo-wide) · high confidence
Sorting algorithms module restructured and expanded
The sorting algorithms package has been reorganized under the new \algorithms.sorting\ namespace, replacing the previous \algorithms.sort\ location. This update introduces a comprehensive suite of sorting implementations, including bead, bitonic, bogo, bubble, bucket, cocktail shaker, comb, counting, cycle, exchange, gnome, heap (max/min), insertion, merge, pancake, pigeonhole, quick, radix, selection, shell, stooge, and wiggle sorts. Additionally, utility functions for sorting-based problems such as \sort\_colors\ (Dutch National Flag) and \can\_attend\_meetings\ are now available within this module.
algorithms/sorting · high confidence
Test coverage
Comprehensive test coverage for algorithms and data structures
Added extensive unit tests across the repository, covering core modules such as arrays, backtracking, bit manipulation, compression (Huffman, RLE, LZW, Elias), data structures (AVL, Red-Black, Trie, Union-Find, Segment Trees), dynamic programming, graph algorithms (Dijkstra, Tarjan, Maximum Flow), greedy methods, heaps, and community-contributed algorithms. Included regression tests to verify audit findings and issue fixes, ensuring correctness for edge cases and specific bug resolutions.
tests · high confidence
Dependencies
Initial project configuration and dependency manifest
The project now includes a pyproject.toml file that defines the package metadata (name 'algorithms', version 1.0.1) and build requirements (setuptools \>= 68.0). It specifies Python 3.10+ as the minimum version and lists development dependencies including pytest, ruff, mypy, and black. Configuration sections are added for pytest, ruff (with specific lint rules), mypy, and black to standardize code quality and formatting.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 66.
Lenses
- Code Health 93
- Architecture 100
- Maturity 64
- Readiness 53
- Security 86
Changes since last survey
- 300 commits — 225 feature/other, 75 fixes
By area
- (root) — 52 commits
- (repo) — 42 commits
- algorithms/graph — 19 commits
- algorithms/maths — 19 commits
- algorithms/arrays — 17 commits
- algorithms/tree — 15 commits
- algorithms/dp — 12 commits
- algorithms/strings — 12 commits
- algorithms/search — 11 commits
- algorithms/sort — 9 commits
- algorithms/data_structures — 8 commits
- algorithms/math — 8 commits
- algorithms/matrix — 6 commits
- algorithms/string — 6 commits
- .github/workflows — 5 commits
- algorithms/compression — 4 commits
- algorithms/heap — 4 commits
- algorithms/stack — 4 commits
- docs/index.html — 4 commits
- algorithms/automata — 3 commits
Notable commits
- fix: Fix issue probably-meant-fstring found at https://codereview.doctor (#864)
- fix: fix bugs, add descriptions, and add tests (#486)
- fix: fix bugs, add descriptions, and add tests (#487)
- fix: #567 issue fixed (#568)
- fix: Add data structure tests, fix README coin_change example
- fix: Add usage section to modal, fix doctest parsing, hide re-export noise
- fix: Bug fix: Add None checks for the boundary values. (#832)
- fix: Bugfix: Add missing import for rotate_alt test
- fix: Fix #756 (#771)
- fix: Fix #768 (#770)
- fix: Fix AVL in_order_traverse crash and remove duplicate tests
- fix: Fix BFS O(n²) regression, bellman_ford sink nodes, heap invariant bugs
- fix: Fix CI: build backend, linter config, and lint errors
- fix: Fix all 737 ruff lint errors with strict rules restored
- fix: Fix array plus one v3 (#432)
- fix: Fix broken link in wiki (fenwick tree) (#790)
- fix: Fix collections.iterable warning (#553)
- fix: Fix failed test with negative search key & refactor code (#775)
- fix: Fix falsy-zero bug in BST validation, deduplicate TreeNode definitions
- fix: Fix flake8 issues (#836)
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
keon/algorithms 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 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 25772ca62d04a8bbd31faac27455c9fa94227b50 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.