Crates.io | procrastination_sort |
lib.rs | procrastination_sort |
version | 1.1.0 |
created_at | 2025-09-09 03:15:03.51266+00 |
updated_at | 2025-09-10 23:50:27.919502+00 |
description | The laziest in-place sorting algorithm. |
homepage | |
repository | https://gitlab.com/uptu/procrastination-sort |
max_upload_size | |
id | 1830224 |
size | 32,918 |
"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.
cargo add procrastination_sort
will add the package to your Rust project.
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.
Don't. It's not worth it.
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.