A personal collection of reusable competitive programming code templates, algorithms, data structures, and utility functions that I frequently use while solving problems and participating in programming contests.
This repository is designed as a quick reference and code library to help reduce implementation time during contests.
The main purpose of this repository is to maintain commonly used competitive programming implementations in one organized place.
It helps me to:
- Quickly access frequently used code
- Reduce implementation time during contests
- Reuse tested algorithms and data structures
- Maintain commonly used templates
- Review important competitive programming concepts
- Prepare for programming contests
- Keep useful snippets organized for future reference
The library may contain reusable implementations for:
- Arrays
- Linked Lists
- Stack
- Queue
- Deque
- Priority Queue
- Set
- Multiset
- Map
- Unordered Map
- Heap
- Trie
- Segment Tree
- Fenwick Tree / BIT
- Disjoint Set Union (DSU)
- Binary Search
- Sorting
- Two Pointers
- Sliding Window
- Prefix Sum
- Difference Array
- Greedy Algorithms
- Divide and Conquer
- Recursion
- Backtracking
- Dynamic Programming
- Bit Manipulation
- BFS
- DFS
- Dijkstra
- Bellman-Ford
- Floyd-Warshall
- Topological Sort
- Cycle Detection
- Connected Components
- DSU
- Kruskal
- Prim
- Minimum Spanning Tree
- Shortest Path Algorithms
- GCD / LCM
- Prime Checking
- Sieve of Eratosthenes
- Prime Factorization
- Modular Arithmetic
- Modular Exponentiation
- Combinations
- Permutations
- Euler's Totient Function
- String Hashing
- Pattern Matching
- Prefix Function
- KMP
- Trie
- Frequency Counting
- String Manipulation
- C++ Boilerplate
- Fast I/O
- Debugging Templates
- Common STL Utilities
- Custom Comparators
- Coordinate Compression
- Binary Search Templates
- Graph Templates
- Dynamic Programming Templates
- Number Theory Templates
Competitive-Programming-Code-Library/
│
├── Template/
│ ├── C++_Template.cpp
│ └── Fast_IO.cpp
│
├── Data-Structures/
│ ├── DSU.cpp
│ ├── Segment_Tree.cpp
│ ├── Fenwick_Tree.cpp
│ └── Trie.cpp
│
├── Graph/
│ ├── BFS.cpp
│ ├── DFS.cpp
│ ├── Dijkstra.cpp
│ ├── DSU.cpp
│ ├── Kruskal.cpp
│ └── Topological_Sort.cpp
│
├── Dynamic-Programming/
│ ├── Knapsack.cpp
│ └── LIS.cpp
│
├── Number-Theory/
│ ├── GCD.cpp
│ ├── Sieve.cpp
│ └── Modular_Exponentiation.cpp
│
├── Searching/
│ ├── Binary_Search.cpp
│ └── Two_Pointers.cpp
│
├── Strings/
│ ├── KMP.cpp
│ ├── Hashing.cpp
│ └── Trie.cpp
│
└── README.md