Skip to content

Mmabiaa/dsa_In_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms (DSA) in Python

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.

Table of Contents

  1. Introduction
  2. List of Data Structures and Algorithms
  3. Directory Structure
  4. How to Use
  5. Contributing
  6. License

Introduction

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.

List of Data Structures and Algorithms

Below is a list of the Data Structures and Algorithms implemented in this repository:

  1. Array: Operations such as insert, delete, search, etc.
  2. Linked List: Singly Linked List with operations like insert, delete, reverse, and search.
  3. Stack: Operations including push, pop, peek, and isEmpty.
  4. Queue: Includes enqueue, dequeue, peek, and isEmpty operations.
  5. Binary Search Tree (BST): Functions for insert, search, delete, findMin, and findMax.
  6. Hash Table: Operations for insert, search, delete, resize, and hash function.
  7. Heap (Min/Max): Functions for insert, extract min/max, peek, delete, and heapify.
  8. Graph: Methods for adding vertices/edges, DFS, BFS, and removing vertices.
  9. Trie (Prefix Tree): Operations for insert, search, delete, startsWith, and display.
  10. 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.

Directory Structure

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

How to Use

Clone the Repository

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

Running the Code

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:

Contributing

We welcome contributions to enhance this repository! If you're interested in contributing, please review our guidelines in the Contribution file.

License

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!