Welcome to my Data Structures and Algorithms practice repository. This collection tracks my progress, solutions, and notes for various coding challenges and algorithmic problems.
This repository serves as a personal collection of data structure and algorithm problems, including implementations, explanations, and test cases. It aims to provide a comprehensive guide to common problems and their solutions, making it easier to review and practice.
Each problem is typically contained in its own Python file, named descriptively (e.g., binary_tree_vertical_traversal.py
). Many files include both the solution and associated test cases.
The repository covers a wide range of topics, including but not limited to:
- Binary Trees and Binary Search Trees
- Linked Lists
- Arrays and Strings
- Heaps and Priority Queues
- Graphs
- Dynamic Programming
- Design Problems (e.g., LRU Cache)
- Sorting and Searching
- Stack and Queue
- Hash Tables
- Two Pointers and Sliding Window
- Bit Manipulation
-
Clone the Repository:
git clone https://github.com/your-username/ds-algo-problems.git cd ds-algo-problems
-
Navigate to a Specific Problem: Browse the repository to find a problem you're interested in.
-
Run the Solution: Each solution file can be run independently:
python path/to/solution.py
-
Explore the Code: Each file typically contains:
- Problem description (in comments)
- Solution implementation
- Test cases (where applicable)
Many solutions include built-in test cases. To run the tests:
- Navigate to the specific problem file.
- Run the Python file directly. Most files include a
if __name__ == "__main__":
block that executes the tests.
Example:
python3 merge_sorted_arrays.py
Look for output indicating whether tests passed or failed.
While this is a personal practice repository, suggestions for improvements are welcome:
- Fork the repository
- Create a new branch (
git checkout -b feature/improvement
) - Make your changes
- Commit your changes (
git commit -am 'Add some improvement'
) - Push to the branch (
git push origin feature/improvement
) - Create a new Pull Request
- LeetCode
- HackerRank
- "Cracking the Coding Interview" by Gayle Laakmann McDowell
- GeeksforGeeks
This project is licensed under the MIT License - see the LICENSE file for details.
Happy coding and problem-solving!