This repository contains templates for common algorithms and data structures used in Leetcode problems. The goal is to provide a starting point for solving problems efficiently.
- Reverse
- Floyd's Cycle Detection
- Find middle
- Cycle detection
- Find the first element of the cycle
- Merge
- Fixed size
- Variable size
- Binary Search Tree (BST)
- Preorder traversal
- Inorder traversal
- Postorder traversal
- Level-order traversal
- ZigZag-order traversal
- Reverse Level-order traversal
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
- Binary Search
- Backtracking
- Graphs
- Heap/Priority Queue
- Greedy Algorithms
- Dynamic Programming (DP)
- 1D DP
- 2D DP
- Multi-dimensional DP
- Divide and Conquer
- Sorting algorithms
- Hashing
- Two Pointers (Possibly redundant as they are more used as concepts in nature)
- From opposite direction
- From same direction
- Stack
- Queue
- Array
- Tries
- Bit manipulation
- Union Find
- Create duplicates of templates with more comments and explanations for better understanding.
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have any suggestions or improvements.