Expand description
IndexSort
§Installation
[dependencies]
indexsort = "0.1"
§Example
- See
dtlog
for whenindexsort
is more convenient thansort*
in Rust’s standard library
§Acknowledgements
- Porting Go’s sort package, thanks for Go contributors.
§License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Traits§
- Searchable
- Golang sort interface in Rust.
- Searchable
Ext - Extension trait for
T: Searchable
. - Slice
Ext - Golang’s
sort.Slice
,sort.SliceStable
andsort.SliceIsSorted
in Rust - Sortable
- Golang sort interface in Rust.
- Sortable
Ext - Extension trait for
T: Sortable
.
Functions§
- search
- Golang’s
sort.Search
in Rust. - slice_
is_ sorted - Returns whether the slice x is sorted according to the provided less function.
- sort
- Sort data.
It makes one call to
data.len
to determine n andO(n*log(n))
calls todata.less
anddata.swap
. The sort is not guaranteed to be stable. - sort_
reverse - Sort data in reverse order.
- sort_
slice - Slice sorts the slice x given the provided less function.
- sort_
slice_ stable - Sorts the slice data using the provided less function, keeping equal elements in their original order.
- sort_
stable - Sort data (stable).
- sort_
stable_ reverse - Sort data in reverse order (stable).