Competitive Programming
C++ code library contains useful algorithms for competitive programming.
PDF Version
[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.
Content
A brief explanation to each of the following topics will be added soon, hopefully.
Data Structures
Strings
- KMP
- Z-Algorithm
- Trie
- Suffix Array
- Aho Corasick's Algorithm (comming soon)
Graphs
- 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
Math
- 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
Geomerty
Will be added soon...
Search Algorithms
Sorting Algorithms (comming soon)
- Heap Sort
- Merge Sort
- Quick Sort
- Radix Sort
Other Algorithms
Thanks
Special thanks to anyone contributed to this repository:
- By teaching me any of these topics.
- By inspiring me any code optimizations.
- By being supportive.