MCPcopy Create free account
hub / github.com/douchuan/algorithm / RedBlackTreeV2

Interface RedBlackTreeV2

src/tree/binary/rb2.rs:102–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100use std::ptr::NonNull;
101
102pub trait RedBlackTreeV2<K, V> {
103 fn insert(&mut self, key: K, val: V);
104 fn get(&self, key: &K) -> Option<&V>;
105 /// Removes the smallest element
106 fn delete_min(&mut self);
107 /// Removes the largest element
108 fn delete_max(&mut self);
109 /// Removes the specified element
110 fn delete(&mut self, k: &K);
111 /// Does this symbol table contain the element
112 fn contains(&self, k: &K) -> bool;
113 /// Returns the smallest key
114 fn min(&self) -> Option<&K>;
115 /// Returns the largest key
116 fn max(&self) -> Option<&K>;
117 /// Returns all keys in the symbol table
118 fn keys(&self) -> Vec<&K>;
119}
120
121impl<K, V> RedBlackTreeV2<K, V> for Tree<K, V>
122where

Callers

nothing calls this directly

Implementers 1

rb2.rssrc/tree/binary/rb2.rs

Calls

no outgoing calls

Tested by

no test coverage detected