| 7 | use std::ptr::NonNull; |
| 8 | |
| 9 | pub trait BSTree<K, V> |
| 10 | where |
| 11 | K: Ord, |
| 12 | { |
| 13 | fn insert(&mut self, key: K, val: V); |
| 14 | fn delete(&mut self, key: &K); |
| 15 | fn get(&self, key: &K) -> Option<&V>; |
| 16 | fn min(&self) -> Option<&K>; |
| 17 | fn max(&self) -> Option<&K>; |
| 18 | /// 查找后继元素 |
| 19 | fn succ(&self, key: &K) -> Option<&K>; |
| 20 | /// 寻找前驱元素 |
| 21 | fn pred(&self, key: &K) -> Option<&K>; |
| 22 | } |
| 23 | |
| 24 | impl<K, V> BSTree<K, V> for Tree<K, V> |
| 25 | where |
nothing calls this directly
no outgoing calls
no test coverage detected