procrastination_sort
"I don't want to sort that entry right now."
Many have asked "what if there was a sorting algorithm which just threw unsorted elements to the end of the queue to be sorted later?"
I bring you procrastination sort. This algorithm iterates over a slice of elements, finds any that are larger than the next element, and tosses it to the end of the queue. This can be run over and over until the entire slice is sorted.
Contents
Installation
cargo add procrastination_sort will add the package to your Rust project.
Usage
The package exposes two different functions, sort() and sort_from(). sort()
is an in-place algorithm that takes a &mut [T] as the only function parameter.
sort_from() takes an immutable reference instead, clones the data to a Vec<T>,
and returns that Vec<T> sorted.
Contributing
Don't. It's not worth it.
License
This package is dual-licensed under both the Apache-2.0 and MIT licenses. Feel free to review both and choose whichever suits your needs most when using this package.