This collection contains common algorithm templates and data structure implementations in Java for solving LeetCode problems. All credits to https://jwl-7.github.io/leetcode-cheatsheet/. I copied all to here just because I didn’t like the original layout.
Topics
- Array - Prefix Sum, Sliding Window, Two Pointers
- Backtracking - Recursive backtracking template
- Binary Search - Standard and variants for duplicates
- Binary Tree - BFS and DFS traversals
- Bit Manipulation - Common bit operations
- Data Structures - Trees, Lists, Graphs, Tries, Union Find
- Dynamic Programming - Top-down and Bottom-up approaches
- Graph - BFS, DFS, Dijkstra, Bellman-Ford, MST algorithms
- Hash Map - Subarray counting, Sliding Window with sets
- Heap - Top K elements pattern
- Linked List - Fast/Slow pointers, Reversal
- Matrix - Copy, Diagonals, Rotation
- Sorting - Various sorting algorithms
- Stack - Monotonic stack patterns