Welcome to my Data Structures and Algorithms (DSA) preparation repository! This repository is dedicated to solving DSA problems using Java. Each problem is categorized by patterns such as Two Pointers, Hashmap, Sliding Window, and more. My goal is to systematically improve my problem-solving skills while providing clear and efficient solutions for others to learn from.
- About the Repository
- Folder Structure
- How to Use This Repository
- Progress Tracker
- Contribution Guidelines
- Acknowledgments
This repository is a collection of my Java-based solutions to various DSA problems. Each solution is written in clean, readable, and efficient Java code, with comments explaining the logic where necessary. Problems are grouped by patterns, making it easier to understand and practice specific techniques.
I hope this repository will not only help me track my progress but also assist others who are preparing for technical interviews or improving their DSA skills.
The repository is organized into folders based on problem-solving patterns. Below is an overview of the folder structure:
DSA/
├── Two-Pointer/ # Solutions using the Two Pointer technique
│ ├── Easy # Easy Example problem solved using Two Pointers
│ ├── Medium # Medium Example problem solved using Two Pointers
│ └── Hard # Hard Example problem solved using Two Pointers
│ └── README.md # Explanation of the Two Pointer pattern
├── Hashmap/ # Solutions using Hashmaps
│ ├── Easy # Easy Example problem solved using Hashmap pattern
│ ├── Medium # Medium Example problem solved using Hashmap pattern
│ └── Hard # Hard Example problem solved using Hashmap pattern
│ └── README.md # Explanation of the Hashmap pattern
├── Sliding-Window/ # Solutions using the Sliding Window technique
│ ├── Easy # Easy Example problem solved using Sliding Window pattern
│ ├── Medium # Medium Example problem solved using Sliding Window pattern
│ └── Hard # Hard Example problem solved using Sliding Window pattern
│ └── README.md # Explanation of the Sliding Window pattern
├── Backtracking/ # Solutions using Backtracking
├── Dynamic-Programming/ # Solutions using Dynamic Programming
├── Graphs/ # Solutions related to Graphs
└── README.md # This file
Each folder contains:
- Problem files (e.g.,
Problem1.java,Problem2.java) - A
README.mdfile explaining the pattern and its applications.
-
Clone the Repository
To use this repository locally, clone it using the following command:git clone https://github.com/karanyede/DSA.git
-
Navigate to a Pattern
Browse through the folders to find the pattern you are interested in. For example:cd DSA/Two-Pointer -
Run the Code
Open the.javafiles in your preferred IDE or text editor. Compile and run them using the Java compiler:javac Problem1.java java Problem1
-
Learn and Contribute
Feel free to learn from the solutions or suggest improvements. Contributions are always welcome!
Below is a tracker to monitor my progress across different patterns. I will update this table regularly as I solve more problems.
| Pattern | Problems Solved | Status |
|---|---|---|
| Two Pointer | 0 | 🟥 Not Started |
| Hashmap | 0 | 🟥 Not Started |
| Sliding Window | 0 | 🟥 Not Started |
| Backtracking | 0 | 🟥 Not Started |
| Dynamic Programming | 0 | 🟥 Not Started |
| Graphs | 0 | 🟥 Not Started |
If you would like to contribute to this repository, here are some guidelines:
-
Fork the Repository
Click the "Fork" button on the top-right corner of this repository. -
Create a New Branch
Create a new branch for your contributions:git checkout -b feature/add-problem
-
Add Your Code
Add your solution to the appropriate folder. Ensure your code is well-commented and follows the folder structure. -
Submit a Pull Request
Push your changes to your forked repository and submit a pull request. I will review your contribution and merge it if it aligns with the repository's goals.
If you have any questions or suggestions, feel free to reach out to me:
- GitHub: karanyede