{"id":26295566,"url":"https://github.com/misaghmomenib/sorting-algorithms-python","last_synced_at":"2026-05-19T00:39:06.174Z","repository":{"id":282422858,"uuid":"948542543","full_name":"MisaghMomeniB/Sorting-Algorithms-Python","owner":"MisaghMomeniB","description":"A Collection of Sorting Algorithms Implemented in Python. This Project Provides Efficient and Easy-to-understand Implementations of Five Fundamental Sorting Techniques. ","archived":false,"fork":false,"pushed_at":"2025-03-14T14:28:51.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T15:32:09.957Z","etag":null,"topics":["algorithms","git","open-source","python","sorting-algorithms"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MisaghMomeniB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-14T14:18:41.000Z","updated_at":"2025-03-14T14:35:25.000Z","dependencies_parsed_at":"2025-03-14T15:32:21.886Z","dependency_job_id":"f29c7321-35da-4a3e-bca5-3224afc4ff4a","html_url":"https://github.com/MisaghMomeniB/Sorting-Algorithms-Python","commit_stats":null,"previous_names":["misaghmomenib/sorting-algorithms-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FSorting-Algorithms-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FSorting-Algorithms-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FSorting-Algorithms-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MisaghMomeniB%2FSorting-Algorithms-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MisaghMomeniB","download_url":"https://codeload.github.com/MisaghMomeniB/Sorting-Algorithms-Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681077,"owners_count":20330155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","git","open-source","python","sorting-algorithms"],"created_at":"2025-03-15T04:14:25.685Z","updated_at":"2026-05-19T00:39:06.158Z","avatar_url":"https://github.com/MisaghMomeniB.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔢 Sorting Algorithms in Python\n\nA curated collection of classic **sorting algorithm implementations** in Python, designed for learning, comparison, and educational use.\n\n---\n\n## 📋 Table of Contents\n\n1. [Overview](#overview)  \n2. [Algorithms Implemented](#algorithms-implemented)  \n3. [Installation \u0026 Setup](#installation--setup)  \n4. [Usage \u0026 Examples](#usage--examples)  \n5. [Performance Comparison](#performance-comparison)  \n6. [Code Structure](#code-structure)  \n7. [Testing](#testing)  \n8. [Contributing](#contributing)  \n9. [License](#license)\n\n---\n\n## 💡 Overview\n\nThis repository presents a series of **classical sorting algorithms** implemented in plain Python. Each algorithm includes:\n\n- Clean functional or class-based structure  \n- Docstrings and inline comments explaining the key steps  \n- Example usage and testcase scaffolding  \n\nGreat for algorithm study, teaching, or benchmarking.\n\n---\n\n## ✅ Algorithms Implemented\n\n- **Bubble Sort**  \n- **Insertion Sort**  \n- **Selection Sort**  \n- **Merge Sort**  \n- **Quick Sort**  \n- **Heap Sort**  \n- **Counting Sort** (integer arrays)  \n- **Radix Sort** (integer arrays)  \n- **TimSort**-like built on Python’s built-in `sorted()` (for reference)\n\n---\n\n## ⚙️ Installation \u0026 Setup\n\n```bash\ngit clone https://github.com/MisaghMomeniB/Sorting-Algorithms-Python.git\ncd Sorting-Algorithms-Python\npython3 --version # Requires Python 3.7+\n````\n\nNo external dependencies—everything runs with the Python standard library.\n\n---\n\n## 🚀 Usage \u0026 Examples\n\nEach algorithm script can be run directly or imported:\n\n```bash\npython bubble_sort.py\n```\n\nExample of using it in your code:\n\n```python\nfrom merge_sort import merge_sort\n\narr = [5, 2, 9, 1, 5, 6]\nsorted_arr = merge_sort(arr)\nprint(sorted_arr)  # [1, 2, 5, 5, 6, 9]\n```\n\nCompare algorithms in `benchmark.py` with configurable input sizes:\n\n```bash\npython benchmark.py --size 10000 --runs 5\n```\n\n---\n\n## 📊 Performance Comparison\n\nBenchmarks are provided in `benchmark.py` to measure:\n\n* Time complexity (best/average/worst cases)\n* Memory usage\n* Behavior with randomized vs. nearly-sorted data\n\nResults output to console and saved as `benchmark_results.csv`.\n\n---\n\n## 📁 Code Structure\n\n```\nSorting-Algorithms-Python/\n├── bubble_sort.py\n├── insertion_sort.py\n├── selection_sort.py\n├── merge_sort.py\n├── quick_sort.py\n├── heap_sort.py\n├── counting_sort.py\n├── radix_sort.py\n├── tim_sort.py\n├── benchmark.py          # Compare runtimes\n└── README.md\n```\n\nEach algorithm implements:\n\n* A function (e.g., `def quick_sort(arr)`)\n* Docstrings explaining time/space complexity\n* Standalone `__main__` for demo\n\n---\n\n## 🧪 Testing\n\nBasic assertions included in each algorithm’s `__main__`. To run all tests:\n\n```bash\npython benchmark.py --test\n```\n\nOr add **pytest** later:\n\n```bash\npip install pytest\npytest .\n```\n\n---\n\n## 🤝 Contributing\n\nContributions welcomed! Ideas:\n\n* Add additional sorts (e.g., Shell Sort, Bucket Sort)\n* Implement in in-place vs. functional variants\n* Enhance performance profiling\n* Add visualizations (e.g., Matplotlib animation)\n\nTo contribute:\n\n1. Fork the repo\n2. Create a feature branch (`feature/...`)\n3. Submit a clean Pull Request with descriptive title\n\n---\n\n## 📄 License\n\nDistributed under **MIT License**. See `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisaghmomenib%2Fsorting-algorithms-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisaghmomenib%2Fsorting-algorithms-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisaghmomenib%2Fsorting-algorithms-python/lists"}