A collection of sorting algorithms
Project description
Sorting Algorithms Package
A collection of sorting algorithms implemented in Python.
Introduction
This repository contains a collection of sorting algorithms implemented in Python. The goal of this project is to provide a comprehensive set of sorting algorithms that can be used for educational and practical purposes.
Features
- Implementation of various sorting algorithms, including:
- Bubble sort
- Selection sort
- Insertion sort
Installation
You can install this package using pip:
pip install siwp2005-james-sort
Usage
You can use the sorting algorithms as follows:
from siwp2005-james-sort.src.sort import bubble_sort, insertion_sort, quick_sort
arr = [3, 2, 1]
arr = bubble_sort(arr)
print(arr) # [1, 2, 3]
arr = [3, 2, 1]
arr = insertion_sort(arr)
print(arr) # [1, 2, 3]
arr = [3, 2, 1]
arr = quick_sort(arr)
print(arr) # [1, 2, 3]
Running Tests
To run the tests, navigate to the root directory of the project and run the following command:
python -m unittest tests/test_bubble_sort.py
python -m unittest tests/test_insertion_sort.py
python -m unittest tests/test_quick_sort.py
This will execute the test cases in test_bubble_sort.py,test_insertion_sort.py,test_quick_sort.py and report any failures or errors.
Alternatively, you can run all tests in the tests directory using:
python -m unittest discover -s tests -p 'test_*.py'
This will discover and run all test files in the tests directory that match the pattern test_*.py.
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
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 siwp2005_james_sort-0.0.2.tar.gz.
File metadata
- Download URL: siwp2005_james_sort-0.0.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bf8719187a2e4b07dbc82b046f8bf4846f426700139f18059b74ab25bef44eb
|
|
| MD5 |
7338b92d8d436948cb15232e10531f46
|
|
| BLAKE2b-256 |
ddd9bfeeca31c8862d592cea1d49af06694ba7950bd1e198cefe938ed646bffd
|
File details
Details for the file siwp2005_james_sort-0.0.2-py3-none-any.whl.
File metadata
- Download URL: siwp2005_james_sort-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80a8b41d96d67eddb84be45d99826c655ff343866bb5abc2826194a77533496e
|
|
| MD5 |
82fcd9d6fe231805d0311df9fef0f140
|
|
| BLAKE2b-256 |
5a929414d58010627d8f97a0c8f443814949e835d1fe6d82da4b05f1e9689fdf
|