Welcome to the Data Structures and Algorithms (DSA) repository! This repository features Python implementations of various data structures and algorithms commonly utilized in computer science. Whether you're a beginner or an experienced developer, this resource aims to enhance your understanding and skills in DSA.
- Introduction
- List of Data Structures and Algorithms
- Directory Structure
- How to Use
- Contributing
- License
This repository is crafted to assist learners in implementing both basic and advanced Data Structures and Algorithms using Python. Each implementation is designed for clarity and simplicity, adhering to standard Python coding conventions.
In addition to code, you will find comprehensive explanations for each data structure and algorithm, including their time and space complexities.
Below is a list of the Data Structures and Algorithms implemented in this repository:
- Array: Operations such as insert, delete, search, etc.
- Linked List: Singly Linked List with operations like insert, delete, reverse, and search.
- Stack: Operations including push, pop, peek, and isEmpty.
- Queue: Includes enqueue, dequeue, peek, and isEmpty operations.
- Binary Search Tree (BST): Functions for insert, search, delete, findMin, and findMax.
- Hash Table: Operations for insert, search, delete, resize, and hash function.
- Heap (Min/Max): Functions for insert, extract min/max, peek, delete, and heapify.
- Graph: Methods for adding vertices/edges, DFS, BFS, and removing vertices.
- Trie (Prefix Tree): Operations for insert, search, delete, startsWith, and display.
- Dynamic Programming: Solutions for Fibonacci sequence, longest common subsequence (LCS), and knapsack problem.
Each implementation includes a corresponding Python file (.py) along with a markdown file (.md) that explains the concept in detail, discusses operations and complexities, and provides example usage.
DSA/
|โโData Structure/
| โโโ arrays/
โ โโโ array.py # Python code for Array operations
โ โโโ array.md # Explanation and details for Array
โโโ linked_list/
โ โโโ linked_list.py # Python code for Linked List operations
โ โโโ linked_list.md # Explanation and details for Linked List
โโโ stack/
โ โโโ stack.py # Python code for Stack operations
โ โโโ stack.md # Explanation and details for Stack
โโโ queue/
โ โโโ queue.py # Python code for Queue operations
โ โโโ queue.md # Explanation and details for Queue
โโโ bst/
โ โโโ bst.py # Python code for Binary Search Tree operations
โ โโโ bst.md # Explanation and details for BST
โโโ hash_table/
โ โโโ hash_table.py # Python code for Hash Table operations
โ โโโ hash_table.md # Explanation and details for Hash Table
โโโ heap/
โ โโโ heap.py # Python code for Heap operations
โ โโโ heap.md # Explanation and details for Heap
โโโ graph/
โ โโโ graph.py # Python code for Graph operations
โ โโโ graph.md # Explanation and details for Graph
โโโ trie/
โ โโโ trie.py # Python code for Trie operations
โ โโโ trie.md # Explanation and details for Trie
|
|โโAlgorithm/
| โโโ dynamic_programming/
โ โโโ dynamic_programming.py # Python code for Dynamic Programming
โ โโโ dynamic_programming.md # Explanation and details for Dynamic Programming
โโโ README.md # Project README
โโโ CONTRIBUTING.md # Contribution Guidelines
To get started with this repository on your local machine, clone it using the following command:
git clone https://github.com/mmabiaa/dsa_In_python.git
Navigate to the desired directory (e.g., arrays, linked_list, etc.) to find the relevant .py file. You can run any script directly using Python:
We welcome contributions to enhance this repository! If you're interested in contributing, please review our guidelines in the Contribution file.
This repository is licensed under the MIT License. For more information, please refer to the LICENSE file.
Feel free to explore the repository and dive into the fascinating world of Data Structures and Algorithms! Happy coding!