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

Interface BSTree

src/tree/binary/bst.rs:9–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7use std::ptr::NonNull;
8
9pub trait BSTree<K, V>
10where
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
24impl<K, V> BSTree<K, V> for Tree<K, V>
25where

Callers

nothing calls this directly

Implementers 1

bst.rssrc/tree/binary/bst.rs

Calls

no outgoing calls

Tested by

no test coverage detected