bad-sort
A tiny joke library that implements intentionally terrible sorting algorithms.
Algorithms
-
stalinSort
- Sorts the array by removing any values that arent in the correct order.
-
sort1984
- The array is already sorted and always has been. Big Brother is watching.
-
bogosort
- Your classic bogosort. Shuffle array until it is sorted.
-
marxSort
- Sort an array of numbers by equally distributing the values for each array index
-
miracleSort
- Waits for a miracle to be sorted
-
nihilistSort
- Deletes the array because nothing matters
-
schrodingerSort
- The returned array is both sorted and not sorted until inspected
-
sisyphusSort
- One must imagine Array#sort happy
-
sleepSort
- Sort an array of numbers by sleeping using
setTimeout (async)
Contributing
Feel free to contribute with anything including documentation/code fixes or new sorting algorithms
TODO
- Enterprise Sort
- gaslight sort: called by reference. It returns a different, pre-sorted list. It then proceeds to change the values stored in memory at random times
- microservices sort: make an API request to compare each pair of values
- observer sort: logging the array will show the sorted array but it will keep being unsorted (is this even possible with js)