A comprehensive collection of Data Structures and Algorithms (DSA) implementations in Java. This repository serves as a learning resource and reference guide for fundamental computer science concepts, featuring well-documented solutions and optimized approaches.
DataStruct-Diaries provides practical implementations of core data structures and algorithms with clear explanations. Whether you're preparing for technical interviews, strengthening your CS fundamentals, or exploring algorithmic problem-solving, this repository offers organized, production-ready code examples.
DataStruct-Diaries/
├── Arrays/ # Array-based problems and algorithms
├── LinkedLists/ # Singly, doubly, and circular linked lists
├── Stacks/ # Stack implementations and applications
├── Queues/ # Queue variants and problems
├── Trees/ # Binary trees, BST, AVL, and tree traversals
├── Graphs-MST-Dijkstra/ # Graph algorithms, MST, and shortest path
└── HashMap-and-Comparators/ # Hash-based structures and custom comparators
- Arrays: Dynamic arrays, multi-dimensional arrays, matrix operations
- Linked Lists: Singly linked lists, doubly linked lists, circular linked lists
- Stacks: Array-based and linked list-based implementations
- Queues: Simple queues, circular queues, priority queues, deques
- Trees: Binary trees, binary search trees, AVL trees, tree traversals
- Graphs: Adjacency matrix, adjacency list, graph traversals
- Hash Maps: HashMaps, HashSets, custom comparators
- Sorting: Bubble, selection, insertion, merge, quick, heap sort
- Searching: Linear search, binary search, graph search algorithms
- Graph Algorithms:
- Minimum Spanning Tree (MST) - Prim's and Kruskal's algorithms
- Shortest Path - Dijkstra's algorithm
- Graph traversals - BFS and DFS
- Recursion: Recursive problem-solving techniques
- Dynamic Programming: Optimization problems (as applicable)
- Greedy Algorithms: Greedy approaches for optimization
- Java Development Kit (JDK) 8 or higher
- A Java IDE (IntelliJ IDEA, Eclipse, VS Code) or command line compiler
- Clone the repository:
git clone https://github.com/meet114/DataStruct-Diaries.git
cd DataStruct-Diaries- Navigate to a specific topic:
cd Arrays
# or any other directory- Compile and run a Java file:
javac FileName.java
java FileNameEach directory contains implementations focused on specific data structures or algorithms. Files are organized to make learning progressive and systematic:
- Problem Files: Individual
.javafiles containing specific implementations - Comments: Detailed inline comments explaining logic and time/space complexity
- Examples: Test cases and usage examples where applicable
- Clean, readable code following Java best practices
- Detailed comments and explanations
- Time and space complexity analysis
- Multiple approaches to solve problems
- Real-world applications and use cases
- Interview-focused implementations
Recommended progression for beginners:
- Start with Arrays - fundamental operations and manipulations
- Move to LinkedLists - understand pointer-based structures
- Explore Stacks and Queues - linear data structures
- Study Trees - hierarchical data organization
- Master HashMap and Comparators - efficient lookups and sorting
- Tackle Graphs - complex relationships and algorithms
Contributions are welcome! If you'd like to add new implementations, improve existing code, or fix issues:
- Fork the repository
- Create a new branch (
git checkout -b feature/new-algorithm) - Commit your changes (
git commit -m 'Add new sorting algorithm') - Push to the branch (
git push origin feature/new-algorithm) - Open a Pull Request
- Follow standard Java naming conventions
- Include comments for complex logic
- Add time and space complexity analysis
- Provide example test cases
- Keep code modular and reusable
This repository is built for educational purposes and draws inspiration from classic computer science textbooks, online courses, and coding interview resources.
This project is open source and available for educational purposes.
For questions, suggestions, or feedback, feel free to open an issue or reach out through GitHub.
Happy Coding!
Star this repository if you find it helpful!