https://github.com/terror/sort
Sorting algorithm implementations in Python3
https://github.com/terror/sort
sorting-algorithms
Last synced: 11 months ago
JSON representation
Sorting algorithm implementations in Python3
- Host: GitHub
- URL: https://github.com/terror/sort
- Owner: terror
- Created: 2020-07-27T06:20:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T21:37:34.000Z (about 3 years ago)
- Last Synced: 2025-02-15T09:37:18.298Z (11 months ago)
- Topics: sorting-algorithms
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##
sort
Sorting algorithm implementations in Python3!
## Contents
[Counting sort](https://github.com/terror/sort/blob/master/sort/counting_sort.py)
[Quick sort](https://github.com/terror/sort/blob/master/sort/quick_sort.py)
[Merge sort](https://github.com/terror/sort/blob/master/sort/merge_sort.py)
[Heap sort](https://github.com/terror/sort/blob/master/sort/heap_sort.py)
[Bubble sort](https://github.com/terror/sort/blob/master/sort/bubble_sort.py)
[Insertion sort](https://github.com/terror/sort/blob/master/sort/insertion_sort.py)
[Selection sort](https://github.com/terror/st/blob/master/sort/selection_sort.py)
[Stooge sort](https://github.com/terror/sort/blob/master/sort/stooge_sort.py)
[Pigeonhole sort](https://github.com/terror/sort/blob/master/sort/pigeonhole_sort.py)
[Pancake sort](https://github.com/terror/sort/blob/master/sort/pancake_sort.py)
## Benchmarks
N = 100
```
+-----------------+-----------+
| Algorithm | Time |
+-----------------+-----------+
| Counting sort | 0.0006s |
| Pigeonhole sort | 0.0001s |
| Quick sort | 0.0001s |
| Merge sort | 0.0002s |
| Heap sort | 0.0000s |
| Pancake sort | 0.0007s |
| Bubble sort | 0.0007s |
| Insertion sort | 0.0004s |
| Selection sort | 0.0005s |
| Stooge sort | 0.0695s |
+-----------------+-----------+
```
N = 1000
```
+-----------------+-----------+
| Algorithm | Time |
+-----------------+-----------+
| Counting sort | 0.0424s |
| Pigeonhole sort | 0.0003s |
| Quick sort | 0.0016s |
| Merge sort | 0.0034s |
| Heap sort | 0.0003s |
| Pancake sort | 0.0621s |
| Bubble sort | 0.0779s |
| Insertion sort | 0.0490s |
| Selection sort | 0.0471s |
| Stooge sort | 17.7174s |
+-----------------+-----------+
```
N = 2500
```
+-----------------+-----------+
| Algorithm | Time |
+-----------------+-----------+
| Counting sort | 0.2603s |
| Pigeonhole sort | 0.0008s |
| Quick sort | 0.0045s |
| Merge sort | 0.0089s |
| Heap sort | 0.0009s |
| Pancake sort | 0.3859s |
| Bubble sort | 0.5083s |
| Insertion sort | 0.3186s |
| Selection sort | 0.2812s |
| Stooge sort | 513.7399s |
+-----------------+-----------+
```