Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

siwp2005_james_sort-0.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

siwp2005_james_sort-0.0.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file siwp2005_james_sort-0.0.1.tar.gz.

File metadata

  • Download URL: siwp2005_james_sort-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.7

File hashes

Hashes for siwp2005_james_sort-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e3d95006d86e5dae2074465a32c2c4e1e207c118fb1290368ec95dfbe0cb67a1
MD5 148ce2eac315b7a716d1d24a339ec22f
BLAKE2b-256 21aa7a0be495d5169f715cb7c0681c45e5ee13ed366bc143c1754b889b739a38

See more details on using hashes here.

File details

Details for the file siwp2005_james_sort-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for siwp2005_james_sort-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5a115269d20282a56d01dadade4d7475c60665b3a387491d8039f83f24fa40a
MD5 e66c2e6e8f1183e4b2d50a1ddde7a3c1
BLAKE2b-256 424ea5a3ecd0eff6af22447dc38a89da9ee7b8b3b962575fcf945e7f04502d52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page