Struct std::BST
generic<K, V, C: Order> struct BST {
?&heap struct BSTNode<K, V> root;
C ord;
unsigned long len;
struct NodePool<struct BSTNode<K, V>> pool;
}Fields
Methods
stateless C (Less, Greater): C from the target
ordering value (FnOrder, ...)
insert or overwrite; 0 on OOM
null if missing
the removed value, or null
null if empty
null if empty
Morris in-order traversal: O(n) time, O(1) extra space. Threads each predecessor's empty right link back to its successor while descending and removes the thread on the way back, so the tree is unchanged afterwards.
drop every entry
drops the entries, releases the nodes (Drop)
= drop()