Skip to content

KhalilIbrahimm/DataStructures-and-Algorithms

Repository files navigation

DataStructures-and-Algorithms

This repository is a comprehensive collection of essential algorithms in computer science, implemented in Python. It includes implementations of classic algorithms for graph theory, dynamic programming, scheduling, and optimization. Each algorithm is designed to be modular and easy to integrate into larger projects, making this a valuable resource for both learning and practical applications.

Table of Contents

Algorithms

The repository includes the following algorithms:

  • Graph Algorithms

    • Dijkstra's Algorithm (dijkstra_algorithm.py): Finds the shortest path in a weighted graph.
    • Ford-Fulkerson Algorithm (ford_fulkerson_MaxFlow.py): Computes the maximum flow in a flow network.
    • Kruskal's Algorithm (kruskal_algorithm.py): Finds the minimum spanning tree of a graph.
    • Prim's Algorithm (prims_algorithm.py): Another approach for finding the minimum spanning tree.
  • Optimization and Scheduling

    • Knapsack Algorithm (knapsack.py): Solves the 0/1 knapsack problem.
    • Interval Scheduling (interval_scheduling.py): Finds an optimal subset of non-overlapping intervals.
  • String Matching

    • Levenshtein Distance (levenshtein_distance.py): Calculates the minimum edit distance between two strings.
  • Encoding

    • Huffman Coding (huffmans_code_algorithm.py): Lossless data compression algorithm.
  • Other Algorithms

    • Stable Matching (stable_matching.py): Solves the stable matching problem.
    • Kahn's Algorithm (kahns_algorithm.py): Topological sorting of a directed graph.

Installation

  1. Clone this repository to your local machine.
    git clone https://github.com/yourusername/DataStructures-and-Algorithms.git
  2. Navigate to the project directory.
    cd DataStructures-and-Algorithms
  3. (Optional) Set up a virtual environment.
    python3 -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`

Usage

Each algorithm can be executed independently. For example, to run Dijkstra's Algorithm:

python dijkstra_algorithm.py

Created and Maintained by

Khalil Ibrahim
Master's Student in Machine Learning

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages