Welcome to the Algorithms and Data Structures Exercises repository! This repository is designed to help you practice and master various algorithms and data structures through hands-on coding exercises.
This repository contains a collection of algorithm and data structure exercises that are essential for anyone looking to improve their problem-solving skills and prepare for technical interviews. Each exercise is designed to help you understand the fundamental concepts and apply them to solve real-world problems.
To get started with the exercises, you will need to clone this repository to your local machine. You can do this using the following command:
git clone https://github.com/wcy41gtc/algorithm-data-structure-exercises.git
Navigate to the cloned repository:
cd algorithms-data-structures-exercises
Each exercise is contained within its respective folder, along with a README file explaining the problem statement and any additional information you might need to solve the exercise.
The repository is organized as follows:
algorithms-data-structures-exercises/
│
├── array/
│ ├── exercise1/
│ └── ...
│
├── linked_list/
│ ├── exercise1/
│ └── ...
│
├── stack/
│ ├── exercise1/
│ └── ...
│
├── queue/
│ ├── exercise1/
│ └── ...
│
├── tree/
│ ├── exercise1/
│ └── ...
│
├── graph/
│ ├── exercise1/
│ └── ...
│
├── hash_maps/
│ ├── exercise1/
│ └── ...
│
├── sorting_algorithms/
│ ├── exercise1/
│ └── ...
│
├── search_algorithms/
│ ├── exercise1/
│ └── ...
│
├── projects/
│ ├── exercise1/
│ └── ...
│
└── README.md
Each folder contains exercises related to a specific data structure or algorithm. Inside each exercise folder, you will find:
README.md
: Detailed problem statement and instructions.solution.py
: Placeholder for your solution (in Python).test.py
: Test cases to verify your solution.
Practice problems related to arrays, such as finding the maximum subarray, rotating an array, and more.
Exercises on linked lists, including reversing a linked list, detecting cycles, and merging two sorted linked lists.
Problems involving stack operations like evaluating expressions, checking for balanced parentheses, and implementing a stack using queues.
Queue-related exercises such as implementing a circular queue, using two stacks to create a queue, and solving the "Josephus problem".
Exercises on binary trees, binary search trees, AVL trees, and more. Problems include traversals, finding the height of a tree, and converting a tree to a doubly linked list.
Graph-related problems including depth-first search (DFS), breadth-first search (BFS), detecting cycles, and finding the shortest path.
Exercises involving hash maps, such as implementing a hash map, designing an LRU cache, and solving problems like two-sum and group anagrams.
Practice implementing various sorting algorithms like quicksort, mergesort, bubblesort, and understanding their time complexities.
Exercises on searching algorithms, including binary search, linear search, and searching in a rotated sorted array.
Small standalone projects for real world applications.
We welcome contributions from the community! If you have an exercise you would like to add or an improvement to an existing one, please fork the repository and create a pull request. Make sure to follow the guidelines in the CONTRIBUTING.md
file.
This repository is licensed under the MIT License. See the LICENSE
file for more information.
Happy coding!