Skip to main content

A Python package providing efficient sorting algorithms like Bubble Sort, Insertion Sort, Merge Sort, Selection Sort, Heap Sort, and Quick Sort.

Project description

py3sort

py3sort is a Python package providing a comprehensive suite of efficient sorting algorithms. Designed to offer developers a wide array of sorting techniques, py3sort simplifies the process of organizing data structures with its collection of well-implemented algorithms.

Installation

You can install py3sort via pip:

pip install py3sort

Usage

To utilize py3sort in your Python scripts, simply import the desired sorting algorithms:

from py3sort import bubble_sort, insertion_sort, merge_sort, selection_sort, heap_sort, quick_sort

unsorted_list = [5, 2, 9, 1, 5, 6]

# Sort using Bubble Sort
sorted_list = bubble_sort(unsorted_list)
print("Sorted using Bubble Sort:", sorted_list)

# Sort using Insertion Sort
sorted_list = insertion_sort(unsorted_list)
print("Sorted using Insertion Sort:", sorted_list)

# Use other sorting algorithms similarly

Included Sorting Algorithms

py3sort includes the following sorting algorithms:

  • Bubble Sort: Iteratively sorts elements by comparing adjacent elements and swapping them if they are in the wrong order.
  • Insertion Sort: Builds the final sorted array one item at a time, inserting each element into its correct position.
  • Merge Sort: Employs the divide-and-conquer strategy to recursively divide the list into smaller parts, sorts them, and merges them back in order.
  • Selection Sort: Repeatedly selects the minimum element from the unsorted part and places it at the beginning.
  • Heap Sort: Utilizes a binary heap data structure to sort elements by constructing a heap and successively removing the maximum element.
  • Quick Sort: Divides the list into smaller sublists based on a pivot element, and recursively sorts sublists around the chosen pivot.

Contribution

Contributions to py3sort are welcome! If you have ideas for enhancements or find any issues, feel free to open an issue or create a pull request on the GitHub repository.

Acknowledgments

The py3sort project draws inspiration from various sources and contributors in the field of sorting algorithms. A big thank you to all those who have shared their knowledge and insights!

This README.md now refers to the package as py3sort throughout the document.

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

py3sort-1.0.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

py3sort-1.0.3-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

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