#sorting #slice #constant-time #length #elements #respect #bitonic

const-sort

Sort a slice of elements in constant time (with respect to slice length)

2 releases

0.1.1 Oct 27, 2018
0.1.0 Oct 27, 2018

#70 in #constant-time

MPL-2.0 license

19KB
77 lines

const-sort

This Library provides a Bitonic Sorting Network which makes a best-effort to sort a slice of elements in constant time (with respect to slice length). Obviously, different length slices will take different amounts of time and code caching may make different iterations of the algorithm take different amounts of time. The goal of this crate is to provide a sorting algorithm which takes the same amount of time irrespective of the passed in slice's values.

The constant time-ness has not been rigorously tested as this library is under development. Use at your own peril. You must pass in a constant-time comparator function of your own.

The sort provided is not intended to be high performance.

Dependencies

~39KB