procrastination_sort

Crates.ioprocrastination_sort
lib.rsprocrastination_sort
version1.1.0
created_at2025-09-09 03:15:03.51266+00
updated_at2025-09-10 23:50:27.919502+00
descriptionThe laziest in-place sorting algorithm.
homepage
repositoryhttps://gitlab.com/uptu/procrastination-sort
max_upload_size
id1830224
size32,918
uptu (uptudev)

documentation

README

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.

Commit count: 6

cargo fmt