Whenever I face an interesting problem I document the algorithm that I learned to solve it. The goals of this repository is to have clean, efficient and most importantly correct code.
ā
: If the algorithm is tested
šŗ: If the algorithm is untested
- ā Knapsack 0/1 - O(nC) Bottom-Up implementation (Loops)
- ā š„Sequence Alignment - O(nm)
- ā š„Weighted Interval Scheduling - O(nlog(n))
- ā Kahns Topological Sort - O(n + m)
- ā Bellman-Ford Shortest Path - O(mn)
- šŗ Floyd-Warshall Shortest Path - O(n3)
- ā Dijkstra Shortest Path - Naive implementation
- ā Dijkstra Shortest Path - O(mlog(n)) - Heap implementation
- šŗ Karger's Minimum cut
- šŗ Prim's Algorithm - O(mn) Naive implementation
- ā Prim's Algorithm - O(mlog(n)) Heap implementation
- šŗ Kruskal's Algorithm - O(mn) implementation
- ā Kruskal's Algorithm - O(mlog(n))
- ā Breadth First Search - O(n + m) - Queue Implementation
- ā Depth First Search - O(n + m) - Stack Implementation
- ā Depth First Search - O(n + m) - Recursive Implementation
- šŗ Karatsuba Multiplication - O(n1.585)
- ā Intersection of two sets - O(nlog(n)) + O(mlog(m))
- ā Union of two sets - O(nlog(n)) + O(mlog(m))
- šŗ Pollard p-1 factorization
- šŗ Euclidean Algorithm - O(log(n))
- šŗ Extended Euclidean Algorithm - O(log(n))
- šŗ Sieve of Eratosthenes - O(nlog(log(n)))
- šŗ Prime factorization - O(sqrt(n))
- ā Ceasar Cipher
- šŗ Hill Cipher
- šŗ Vigenere Cipher*
- šŗ One time pad
- šŗ RSA-Algorithm
- šŗ Bisection Method
- šŗ (simple) Fixpoint iteration
- ā Maintaining Median - O(nlog(n))
- šŗ Huffman Algorithm
- ā š„Interval Scheduling - O(nlog(n))
- ā Binary Search - O(log(n))
- ā Bubble sort - O(n2)
- šŗ Hope sort - O(1), hopefully
- ā Insertion sort - O(n2)
- ā Selection sort - O(n2)
- ā Merge sort - O(nlog(n))
- ā Randomized Quick sort - Average O(nlogn) (Input independent!)
- ā Quick sort - Average O(nlog(n))
I appreciate feedback on potential improvements and/or if you see an error that I've made! Also if you would like to contribute then do a pull request with algorithm & tests! :)