A fast sorted list data structure in rust, inspired by the python library Sorted Containers
This repository is a work in progress. See Usage and Documentation for available features.
```rust use sortedlist_rs::SortedList;
let array = vec![90, 19, 25]; let mut sorted_list = SortedList::from(array);
println!("{:?}", sorted_list); // [19, 25, 90]
sortedlist.insert(100); sortedlist.insert(1); sortedlist.insert(20); println!("{:?}", sortedlist); // [1, 19, 20, 25, 90, 100]
let x = sortedlist.remove(3); asserteq!(25, x); // removed the 3-rd smallest (0-indexed) element.
asserteq!(&20, sortedlist.kth_smallest(2));
asserteq!(20, sortedlist[2]);
println!("{:?}", sorted_list); // [1, 19, 20, 90, 100] ```
https://docs.rs/sortedlist-rs/latest/sortedlist_rs/