A Python package for various sorting algorithms
Project description
sortpython
sortpython is a Python library that implements a variety of sorting algorithms. It provides an easy-to-use interface for sorting data using popular algorithms like Quick Sort, Merge Sort, and Bubble Sort.
Features
Features
- Quick Sort: Fast and efficient for most cases.
- Merge Sort: Stable and reliable for large datasets.
- Bubble Sort: Simple and easy to understand.
- Counting Sort: Efficient for sorting integers within a limited range.
- Insertion Sort: Simple and efficient for small or nearly sorted datasets.
- Tim Sort: A hybrid sorting algorithm optimized for real-world data.
- Other algorithms will be release in future
- There is a simple visualization also.
Installation
Install sortpython using pip:
pip install sortpython
Usage
from sortpython.algorithms.TimSort import TimSort
from sortpython.visualize.SortVisualizer import SortVisualizer
data = [64, 34, 25, 12, 22, 11, 90]
visualize = input("Do you want to visualize the sorting process? (y/n): ").strip().lower() == 'y'
if visualize:
visualizer = SortVisualizer(data, 500)
steps_generator = TimSort.sort_with_visualization(data)
visualizer.capture_steps(steps_generator)
visualizer.animate()
print("Sorted Array:", data)
else:
TimSort.sort(data)
print("Sorted Array:", data)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sortpython-0.0.3.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sortpython-0.0.3.tar.gz.
File metadata
- Download URL: sortpython-0.0.3.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba346518ff98ca6284f9b7fa4538c0bd5458adc4ebec9780beb8fac9b2200951
|
|
| MD5 |
97aabd17860ca1a29b381cf7aa7e85ea
|
|
| BLAKE2b-256 |
08bec40cffe5b8fee11adbcf753905969317d77d1a2cc00e8a6c3c70ed3d9996
|
File details
Details for the file sortpython-0.0.3-py3-none-any.whl.
File metadata
- Download URL: sortpython-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1f12d0771a8e1dd34ac0db95e5c34773502f14f2da59e28d3589a7ac7ebe9cc
|
|
| MD5 |
91d69eb4abca76fae9baba4c720b2be6
|
|
| BLAKE2b-256 |
d796b46e32bfc93e9187398b0ba1770a11e77072872c016ef26d9d8ebb5ce223
|