A comprehensive Java library of 150 core algorithms
for Competitive Programming, LeetCode, and SDE 1/2/3 interview preparation.
About • Structure • Categories • Why • Tech Stack • Content • Support
This repository contains a carefully structured collection of 150 essential algorithms implemented in Java.
| 🏆 Competitive Programming | Codeforces, AtCoder, CodeChef, etc. |
| 💻 LeetCode & Coding Platforms | Pattern-driven problem solving |
| 🎯 Technical Interviews | SDE 1 / SDE 2 / SDE 3 |
| 📈 Long-term Mastery | Data Structures & Algorithms |
- ✨ Clean structure
- ⚡ Optimal time & space complexity
- 🔁 Reusability for contests
- 🧑💻 Interview-ready coding standards
CP-Core-Algorithms-150/
└── src/main/java/org/algos/
├── Arrays
├── SearchingAndSorting
├── Strings
├── Stacks
├── QueueAndDeque
├── LinkedList
├── Trees
├── Graphs
├── DynamicProgramming
├── Greedy
├── RecursionORBacktracking
├── MathORNumberTheory
├── BitManipulation
└── AdvancedAndRare
| Category | What's Inside |
|---|---|
| 🔢 Arrays | Prefix Sum, Two Pointers, Sliding Window, Kadane's Algorithm, Subarray problems |
| 🔍 Searching & Sorting | Binary Search Variations, Merge Sort, Quick Sort, Custom Comparator usage |
| 🌐 Graphs | BFS, DFS, Dijkstra, Bellman-Ford, Floyd-Warshall, Topological Sort, DSU, MST |
| 🧠 Dynamic Programming | 0/1 Knapsack, LIS, LCS, Matrix DP, Digit DP, Bitmask DP |
| 🌳 Trees | Binary Tree Traversals, BST operations, LCA, Segment Tree, Fenwick Tree |
| 🧮 Math & Number Theory | Sieve of Eratosthenes, GCD, Modular Arithmetic, Fast Power, Combinatorics |
| ⚙️ Bit Manipulation | Bitmasking techniques, Subset generation, XOR patterns |
| 🔁 Recursion & Backtracking | Permutations, Combinations, N-Queens, Subsets, Constraint search problems |
| 💡 Greedy | Activity Selection, Interval Scheduling, Greedy proof-based solutions |
| 📚 Stack / Queue / LinkedList | Monotonic Stack, Deque optimization, Classic Linked List operations |
| 🧪 Advanced & Rare | Advanced data structures and specialized competitive programming techniques |
- ✅ 150 battle-tested algorithms
- ✅ Structured, category-wise organization
- ✅ CP + LeetCode + Interview focused
- ✅ Clean and reusable Java implementations
- ✅ Built for serious problem solvers
This repository serves as 📘 a Competitive Programming revision handbook, 💼 an interview preparation toolkit, and 🚀 a long-term algorithm mastery project.
- Language: Java
- Focus: Performance + Clarity
- Structure: Competitive Programming oriented
- Scalability: Designed to expand beyond 150
For structured explanations and algorithm deep-dives:
If this repository helps you:
- ⭐ Star the repo
- 🍴 Fork it
- 📣 Share it
- 🚀 Use it in your CP journey
🚀 Keep Grinding. Keep Building. Keep Winning.