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 algorithms.TimSort import TimSort
from 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.2.tar.gz
(5.4 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.2.tar.gz.
File metadata
- Download URL: sortpython-0.0.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d5a3dd0699dde59a38575c27437ec88512eef549a003f93ce25a4a6d77747a4
|
|
| MD5 |
b374042b145ef0673a8cf0803107024e
|
|
| BLAKE2b-256 |
87f16b4afdc18c73689aebf934537ccbec71c84b650079afd8f9ff70b97753fa
|
File details
Details for the file sortpython-0.0.2-py3-none-any.whl.
File metadata
- Download URL: sortpython-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.5 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 |
f5e49841a062c242ff2852317bbdc8d02433f3dbe2b82311e4c62ccfc8a19429
|
|
| MD5 |
0e513fdf793dfb53f63180deae7a1f80
|
|
| BLAKE2b-256 |
2376ece932d2da56b66e0f4da00cfe231f9379ad7f716c660d069da371878357
|