thealgorithm
Project · library · 2025
thealgorithm is a Python package of common algorithms and data structures, written from scratch and tested.
Contents
- Data structures
- arrays, lists, nodes, stacks, queues, priority queues and trees, all built on shared abstract base classes.
- Sorting
- heap sort and quicksort.
- Hashing
- MD2, SHA-1 and SHA-2, implemented from their specifications.
- Compression
- Huffman coding and run-length encoding.
- Text and data
- cosine similarity and edit distance.
- Machine learning
- Pegasos, a fast method for training support-vector machines.
- Assessment
- the discrimination index, which measures how well an exam question separates strong students from weak ones.
Tests run in GitHub Actions, and the package installs with setup.py.
See also
In the knowledge graph
thealgorithm and the 13 things it is linked to. Open any dot for its page, or explore it in the full graph.
As data
Everything on this page is read from triples in the knowledge graph. These are the 26 it states about thealgorithm, and 9 more its ontology implies; the console runs SPARQL over the whole graph, here in your browser.
@prefix id: <https://ask.chaipat.cc/id/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix cj: <https://ask.chaipat.cc/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . id:TheAlgorithm a cj:Project ; rdfs:label "thealgorithm" ; cj:description "Common algorithms implemented and tested in Python." ; cj:context id:OpenSource ; cj:repository "https://github.com/AppleBoiy/thealgorithm"^^xsd:anyURI ; cj:firstCommit "2025-01-01"^^xsd:date ; cj:lastCommit "2025-01-08"^^xsd:date ; cj:commitCount 28 ; cj:kind "library" ; cj:license "MIT" ; cj:theme id:ThemeAlgorithms ; cj:uses id:Python , id:GitHubActions , id:MachineLearning ; cj:tier 2 ; cj:implements id:Heapsort , id:Quicksort , id:SHAHash , id:HuffmanCoding , id:RunLengthEncoding , id:CosineSimilarity , id:EditDistance , id:Pegasos ; cj:article "https://ask.chaipat.cc/wiki/TheAlgorithm"^^xsd:anyURI ; cj:activeIn id:Y2025 ; cj:activity _:b155 .