Skip to main content

Fully tested and documented version of the Wasteland sorting algorithm

Project description

Wasteland-sort

Wasteland sort is an O(m + n) running time sorting algorithm developed with the intention of creating a general purpose O(n) sorting algorithm.

To run the algorithm, call wasteland_sort() and pass in your array to be sorted. The sort is pseudo in-place but unstable. Any element in the array will be replaced. Currently, Wasteland sort only sorts integers, so integer representations of objects can also be sorted, though it won't be very helpful if their hashes aren't unique.

If you have questions about the algorithm, feel free to open an issue and I'll get in contact.


To import the module, you can use the statement import wasteland. To directly access the file where wasteland_sort lives, use from wasteland import wasteland_sort.

Example usage

from wasteland import wasteland_sort as ws
from typing import List, Tuple

x : List[int] = [645,111234,78,4,72,9,3344,1]
y : List[int] = [645,111234,78,4,72,9,3344,1]

#Calling the wasteland find_extremes() method
least, most = ws.find_extremes(x)

#Calling the wasteland sorting algorithm
ws.sort(x, True)
ws.sort(y, False)

# y = [1, 4, 9, 72, 78, 645, 3344, 111234]
# x = [111234, 3344, 645, 78, 72, 9, 4, 1]
# least = 1
# most = 111234

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

wasteland_sort-1.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

wasteland_sort-1.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file wasteland_sort-1.1.0.tar.gz.

File metadata

  • Download URL: wasteland_sort-1.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.5

File hashes

Hashes for wasteland_sort-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7e3a8a1ed2665acdd51bacf2269a069b08bbc760c704e17838cd86d42bfb87e5
MD5 a085079e68c717b62912dc77d87ac81d
BLAKE2b-256 4436a08ca9157ee23f4ea5b067a30ef205237cfb39a98f2943f4941e93f7106d

See more details on using hashes here.

File details

Details for the file wasteland_sort-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: wasteland_sort-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.5

File hashes

Hashes for wasteland_sort-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b86ee8b189cc433707541b415b2892f1e532b60be6be0fd35602cada1fc10614
MD5 a9501f0501f9028337459d275a5eb0c2
BLAKE2b-256 c9f54262cede397b29774195675840ff796c0c64d4e075d333ec4e7f239f4d79

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