Crates.io | treap |
lib.rs | treap |
version | 0.0.3 |
source | src |
created_at | 2015-02-09 10:29:58.573477 |
updated_at | 2015-12-11 23:59:34.806356 |
description | Randomized treap implementation |
homepage | https://github.com/mbudde/treap-rs |
repository | https://github.com/mbudde/treap-rs |
max_upload_size | |
id | 1365 |
size | 20,706 |
A randomized treap implementation.
extern crate treap;
use treap::TreapMap;
fn main() {
let mut t = TreapMap::new();
for i in range(0, 10) {
t.insert(i, i);
}
for (k, v) in &mut t {
*v = *v * *v;
}
assert_eq!(t.get(&5), Some(&25));
assert_eq!(t.remove(&3), Some(9));
}
Add this to your Cargo.toml
:
[dependencies]
treap = "*"
and this to your crate root:
extern crate treap;