Skip to main content

The hottest sorting algorithm around!

Project description

Volcano Sort

The hottest sorting algorithm around!

Disclaimer

This algorithm runs in O(n2). Please don't use this.

Motivation

Our professor mentioned volcanoes when discussing sorting algorithms. I realized there wasn't a "Volcano Sort". There shouldn't be, but now there is.

Methodology

This algorithm first constructs a volcano from the input. Then, the volcano "erupts" and places the numbers in sorted order.

What does this mean?

Given the following input: [4,8,2,2,1,3,0], Volcano Sort will construct a volcano: [1,2,4,8,3,2,0]. It looks like this:

volcano-diagram

The volcano will erupt and place numbers in increasing order.

Output: [0,1,2,2,3,4,8]

Installation

pip install VolcanoSort

Usage

from VolcanoSort import volcano

arr = [4, 5, 8, 1, 2, 3, 7, 6, 9]
arr = volcano.sort(arr)
print(arr)
[1, 2, 3, 4, 5, 6, 7, 8, 9]

Future Development

None!

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

VolcanoSort-1.0.4.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

VolcanoSort-1.0.4-py3-none-any.whl (3.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