Usually it's helpful for the competitive programmers to keep their own templates.In the time of contest, we have to solve problems and write codes as fast as possible.Some times we need various complex algorithms, data structures etc which will take much times to implement them in contest time.So, keeping the templates and using them when necessary is a good choice.
- Big Integer Library
- Data Structure
- Dynamic Programming
- Graph Theory
- Number Theory
- Strings
- Supports all arithmetic operations.
- Disjoin Set Union Find ( Finding connected components )
- Heavy Ligh Decomposition ( On tree query problems, as like as LCA query )
- MO's Algorithm ( Offline Queries , Complexity: O(M * sqrt(N)))
- PBDS-Policy Based Data Structure ( Order statics set )
- Segment Tree ( Effecient Segment tree with query + update )
- Square Root Decomposition ( Offline Queries )
- Trie (Data compression + String queris)
- Wavelet Tree
- LCA (Lowest Common Ancestro)
- Coin Change
- 0 - 1 knapsack
- Rod Cutting ( maximize or minimize )
- Bitwise DP ( Subsets )
- LIS (NlogN) (Longest increasing Subsequence)
- LCS (longest common subsequence)
- Maximum Rectange Sum variations
- Shortest path
- Minimum spanning trees
- Strongly connected components
- Topological sorting
- Bridges
- Cycle Finding
- Millar Rabin + pollard rho ( Big prime factorisation )
- Primse , Factorisations, Factorials , Divisors
- Gcd , Lcm
- Number theory cpp notes
- Combinatorics
- KMP ( knuth-morrison-prat algorithm, Substring search, longest pallindrome, string compression )
- Z Algorithm ( Same as kmp )
- Hashing ( basically it's a data structure but some string operations can be done effeciently)
- Bubble Sort ( Complexity : O(N^2) )
- Counting Sort ( Complexity : O(N) )
- Heap Sort ( Complexity : O(NlogN) )
- Insertion Sort ( Complexity : O(N^2) )
- Merge Sort ( Complexity : O(NlogN) )
- Quick Sort ( Complexity : O(NlogN) )
- Selection Sort ( Complexity : O(N^2) )