https://github.com/mbudde/treap-rs
A randomized treap implementation in Rust
https://github.com/mbudde/treap-rs
Last synced: 4 months ago
JSON representation
A randomized treap implementation in Rust
- Host: GitHub
- URL: https://github.com/mbudde/treap-rs
- Owner: mbudde
- Created: 2015-02-07T16:37:40.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-10-17T17:14:38.000Z (about 7 years ago)
- Last Synced: 2025-07-04T22:08:02.764Z (5 months ago)
- Language: Rust
- Size: 564 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# treap-rs
[](https://travis-ci.org/mbudde/treap-rs)
A randomized treap implementation.
[Documentation](http://mbudde.github.io/treap-rs/treap/index.html)
## Example
```rust
extern crate treap;
use treap::TreapMap;
fn main() {
let mut t = TreapMap::new();
for i in 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));
}
```
## Usage
Add this to your `Cargo.toml`:
```toml
[dependencies]
treap = "*"
```
and this to your crate root:
```rust
extern crate treap;
```