A C++ code library that contains useful data structures and algorithms tailored for competitive programming contests.
[1] You can download an easy printable minified PDF version of this library from here.
[2] You can download Theoretical Computer Science Cheat Sheet from here.
- KMP
 - Z-Algorithm
 - Trie
 - Suffix Array
 - Aho Corasick's Algorithm (coming soon)
 
- Graph Traversal and Representation
 - Topological Sort
 - Shortest Path
- Single Source Shortest Path (SSSP)
 - All Pair Shortest Path (APSP)
 
 - Minimum Spanning Tree
 - Strongly Connected Components (SCC)
 - Lowest Common Ancestor (LCA)
 - Max Flow
 - Others
 
- Basic Discrete Math & Modular Arithmetics
- Greatest Common Divisor (GCD)
 - Least Common Multiple (LCM)
 - Bézout's Coefficients (using extended Euclid's method)
 - Fast Power
 - Modular Inverse
 - Combinations (nCr)
 - Combinations (nCr) for Large Numbers
 - Pascal Triangle
 - Check Integer Primality
 - Check Integer Primality using Miller Rabin
 - Generate Prime Numbers (using Sieve of Eratosthenes' algorithm)
 - Generate Divisors (single/bulk operation)
- All divisors
 - Prime divisors
 
 
 - Matrix Operations
 
Will be added soon...
- Heap Sort
 - Merge Sort
 - Quick Sort
 - Radix Sort
 
Special thanks to anyone contributed to this repository:
- By teaching me any of these topics.
 - By inspiring me any code optimizations.
 - By being supportive.