Skip to content

dipti-2211/Python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 The Algorithms - Python

The definitive, open-source collection of all algorithms implemented in Python.

A collaborative educational project dedicated to providing clear, executable, and well-documented examples for fundamental and advanced computer science algorithms.


📈 Stats & Status

Metric Status
Stars GitHub Stars
Forks GitHub Forks
Contributors 1,250+ Active Community Members
License License: MIT
Code Style Pre-Commit Code Style
Ready-to-Code Open in Gitpod

🎯 Project Goals

This repository is an invaluable resource for:

  • Students: To see working examples of algorithms learned in class.
  • Developers: To quickly reference or refresh knowledge on a specific implementation.
  • Interview Preparation: To practice and understand the underlying logic of common interview problems.

Our Core Philosophy: Clarity over Performance. Implementations prioritize readability and educational value. They are not optimized for production-grade speed.


📂 Repository Structure & Key Domains

The project is meticulously organized into folders, each representing a core domain in computer science.

Domain Example Topics
Data Structures Linked Lists, Trees, Heaps, Hash Maps
Searching & Sorting Binary Search, Bubble Sort, Merge Sort, Quickselect
Mathematics Number Theory, Prime Sieve, Matrix Operations, Geometry
Advanced CS Dynamic Programming, Greedy Methods, Divide and Conquer
Graph Theory BFS, DFS, Dijkstra's, Kruskal's, Network Flow
Security & Privacy Ciphers (Caesar, Vigenere), Hashes (SHA, MD5)
Modern Tech Machine Learning, Computer Vision, Blockchain, Quantum Computing

➡️ Explore All Algorithms: View the full, categorized list in our DIRECTORY.md.


🛠️ Getting Started: Your First Run

Prerequisites

  • Python 3.8+
  • (Optional but Recommended) A Python virtual environment.

Installation

Clone the repository and install necessary dependencies:

# 1. Clone the repository
git clone [https://github.com/TheAlgorithms/Python.git](https://github.com/TheAlgorithms/Python.git)
cd Python

# 2. Install dependencies (We recommend 'uv' for speed)
# pip install uv
# uv sync

# OR using pip
pip install -r requirements.txt
Running an Example
Algorithms are designed to be run directly for testing. Many include doctests for built-in verification.

Bash

# Example: Running the Fibonacci sequence algorithm
python maths/fibonacci_sequence.py

# Example: Running a Graph algorithm
python graphs/depth_first_search.py

🚀 Contribute and Grow

This is a 100% community-driven project. Your contributions are the lifeblood of this repository!

How to Get Involved Read the Guidelines: Start with the comprehensive CONTRIBUTING.md for a step-by-step guide.

Find an Issue: Look for open issues labeled good first issue if you're new, or tackle a high-priority bug or missing algorithm.

Submit a Pull Request (PR): Ensure your code is clean, well-commented, and adheres to the Black code style standard.

Your contribution helps millions learn computer science!

💬 Community & Support

Need help, have a suggestion, or just want to discuss an algorithm? Join our vibrant community!

Platform Link Purpose Discord Join our Server Real-time chat, quick help, and contribution coordination. Gitter Join our Chat General discussion and support channel.

Export to Sheets ⚠️ Important Disclaimer The code in this repository is designed for education and demonstration. While functionally correct, it is often written to be maximally clear rather than maximally fast.

Do not use this code in a high-performance or production environment. For optimal performance in a production setting, rely on the optimized functions within Python's Standard Library or well-established third-party libraries.

© License

This project is open source and available under the MIT License.

About

All Algorithms implemented in Python

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Other 0.2%