Welcome to the Data Structures and Algorithms in Java repository!
This repository provides a comprehensive collection of Java implementations for various data structures and algorithms commonly used in computer science, competitive programming, and technical interviews.
Whether you're a beginner starting your DSA journey or an experienced developer revisiting the core concepts, this repository is a helpful resource designed for clear understanding and practical application.
Data Structures and Algorithms (DSA) are the foundation of efficient programming. Mastering DSA helps you:
- Write optimal code
- Solve complex problems efficiently
- Prepare for coding interviews at top tech companies
This repository aims to provide:
- Clean, readable Java implementations
- Conceptual explanations and comments
- Real-world use cases and patterns
| Topic | Resource(s) |
|---|---|
| LinkedList, Searching & Sorting | Kunal Kushwaha |
| Stacks & Queues | Pepcoding |
| Trees & BSTs | Take U Forward |
| Recursion | Pepcoding |
| Dynamic Programming | Take U Forward |
| Graphs | Take U Forward |
| Heaps | Anuj Bhaiya |
| Greedy Algorithms | DSA Playlist (Check link in YouTube description) |
| Algorithms Questions | TechDose, Take U Forward, CodeNCode, Fraz, Pepcoding |
A beginner-friendly learning roadmap curated by Striver.
Simple, linear data structures. This section includes:
- Traversal, Insertion, Deletion
- Two-pointer and Sliding Window techniques
- Prefix sums and Kadane’s Algorithm
Includes:
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Operations like reversal, detection of cycles, etc.
LIFO structure with:
- Array & LinkedList implementations
- Use-cases like balanced parentheses, Next Greater Element, etc.
FIFO structure:
- Linear Queue
- Circular Queue
- Deque
- Queue using Stacks & Vice Versa
Covers:
- Binary Trees
- Binary Search Trees (BST)
- Tree traversals (DFS, BFS)
- Height, Diameter, LCA, etc.
Graph topics include:
- Representations (Adjacency Matrix/List)
- DFS, BFS
- Cycle detection, Topological Sort
- Dijkstra’s & Prim’s algorithms
HashMap & HashSet-based problems:
- Frequency count
- Two Sum, Group Anagrams
- Collision handling
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Counting/Radix Sort (if applicable)
- Linear Search
- Binary Search (Iterative/Recursive)
- Applications: Rotated Arrays, First/Last Occurrence, etc.
- DFS, BFS
- Dijkstra’s
- Bellman-Ford
- Floyd-Warshall
- Union-Find / Disjoint Set
- Memoization & Tabulation
- Classic problems: Knapsack, LIS, LCS, etc.
- Activity Selection
- Fractional Knapsack
- Huffman Coding (if applicable)
Contributions are welcome! 🚀
If you have new implementations, optimizations, or documentation improvements:
- Fork the repository
- Create a feature branch
- Commit your changes
- Submit a pull request
Please ensure your code:
- Is readable and well-commented
- Includes example inputs if necessary
- Follows Java best practices
Refer to CONTRIBUTING.md (coming soon) for detailed guidelines.
This repository is licensed under the MIT License.
You are free to use, modify, and distribute the code for personal or commercial use.
See the LICENSE file for full details.