Skip to main content

Really really bad sorting algorithms

Project description

How to use

pip install shitsort

example usage:

import shitsort

myarray = [1, 5, 12, 6, 6, 11]

print(shitsort.bogosort(myarray))
print(shitsort.multibogosort(myarray, 4)) # uses 4 processes
print(shitsort.bozosort(myarray))
print(shitsort.slowsort(myarray))
print(shitsort.permutationsort(myarray))
print(shitsort.multipermutationsort(myarray, 4)) # uses 4 processes

>>> [1, 5, 6, 6, 11, 12]
>>> [1, 5, 6, 6, 11, 12]
>>> [1, 5, 6, 6, 11, 12]
>>> [1, 5, 6, 6, 11, 12]
>>> [1, 5, 6, 6, 11, 12]
>>> [1, 5, 6, 6, 11, 12]

functions:

bogosort(array)

returns a new sorted array of array using the bogosort algorithm without modifying the passed in array. (pseudocode)

multibogosort(array, numthreads)

returns a new sorted array of array using the bogosort algorithm without modifying the passed in array, but on multiple processes simultaneously. The number of processes can be specified with numthreads. Causes absurd CPU usage.

bozosort(array)

returns a new sorted array using the bozosort algorithm, without modifying the passed in array. (paper includes pseudocode somewhere)

slowsort(array)

returns a new sorted array using the slowsort algorithm, without modifying the passed in array. (pseudocode)

permutationsort(array)

returns a new sorted array by creating every permutation of the passed in array and looking through them. Uses absurd amounts of memory.

multipermutationsort(array, numthreads)

returns a new sorted array by creating every permutation of the passed in array and looks through it on numthreads processes. Uses absurd amounts of memory and CPU.

contributors: sh6heer, jas-dzied

Licensed under GPL GNUv3

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

shitsort-1.2.0.tar.gz (15.3 kB view hashes)

Uploaded Source

Built Distribution

shitsort-1.2.0-py3-none-any.whl (17.3 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