My implementations of classic algorithms and data structures in Python, C, C++ and Java.
- Tests included
- Clean code
- In 4 major programming languages
- Vector
- Hash Set
- Binary Search Tree
- Heap
- Disjoint Set (Union-Find)
- Trie
- Segment Tree
- Binary Indexed Tree
Category | Algorithms |
---|---|
search | binary search, bisect |
sorting | bubble sort, selection sort, merge sort, heap sort, quick sort, k-way merge sort |
selection | quick select, BFPRT select |
linked list | find middle, reverse linked list, cycle detection, merge sort |
stack | next greater |
tree traversal | recursive, stack, Morris |
minimal spanning tree | Prim's, Kruskal's |
graph | connected component, bipartite test, tree test |
shortest path | bfs, Dijkstra's, Bellman–Ford, SPFA, Floyd–Warshall, Johnson's |
graph search | bidirectional, depth limited, iterative deepening |
topological sort | Kahn's, DFS-based, Viterbi shortest path |
recursion | permutations, combinations, subsets, partitions |
string | naive string matcher, KMP string matcher |
math | gcd, extended gcd, CRT |
majority | Boyer–Moore majority vote |
sampling | selection-rejection, reservoir sampling, weighted sampling |
shuffle | Fisher–Yates |
dutch national flag | three way partition |