My own templates and implementation of important algorithms and data structures for competitive programming
My profile: Codeforces, AtCoder
- Graph Traversing (DFS, BFS)
- Flood Fill
- Minimum Spanning Tree (Kruskal, Prim)
- Shortest Paths (Dijkstra, Bellman-Ford, 0-1 BFS, Floyd Warshall)
- Bridges and Articulation Points
- Strongly Connected Components (Tarjan, Kosaraju)
- Bipartite Matching
- Topological Sort (DFS, in_deg)
- Maximum FLow (Edmonds-Karp, Dinic)
- Lowest Common Ancestor (Binary Lifting, RMQ)
- 0-1 Knapsack
- Coin Change
- Max Sum Subarray: 1D, 2D
- Longest Common Subsequence
- Longest Increasing Subsequence
- Digit DP
- SOS DP
- Weighted Job Scheduling
- Cutting Sticks
- Matrix Chain
- Elevator Rides
- Travelling Salesman Problem
- Deque Trick
- Divide & Conquer Trick
- Convex Hull Trick
- Sparse Table
- Fenwick Tree
- Segment Tree
- Treap
- SQRT Decomposition + Mo's Algorithm
- Disjoint Set Union
- Trie
- Suffix Array
- Policy-based data structures C++ STL
- Heavy Light Decomposition
- Pattern Searching (KMP, Z-Algorithm, Rabin-Karp)
- Sieve of Eratosthenes
- Greatest Common Divisor (Euclidean Algorithm)
- Quick Exponentiation
- Fibonacci
- Binomial Coefficients
- Sweep Line: Closet Pairs, Rectangle Union