Systems in Rust
VecDefinition: A tree in which every level, except possibly the deepest, is entirely filled. At depth n, the height of the tree, all nodes are as far left as possible.
Definition: A k-ary tree with all leaf nodes at same depth. All internal nodes have degree k.
Note: Authors differ in their definitions. This is called “complete” by [CLR90, page 95].
I take CLR as ground truth (more often 2nd+ edition as “CLRS”)
struct HashTree {
data: String; // Is it a string?
left: Option<Box<HashTree>>;
rite: Option<Box<HashTree>>;
}128 as an initial value128 is the maximium, and also the root/initial value12864 here64 is \(\leq\) 128 so this is “A-OK”
128192 here.192 and 12806496 here.96 \(\gt\) 64 so swap96 \(\leq\) 192 so terminateVec.0. \(0\).160 is Inserted as the element at zero-index location 4160 is at swaps at zero-index location 1
3 also would’ve swapped to 1
4 -> 1 is an off-by-one int div1), not zero (0).6.6224 there6224 there3 = 6/26224 there3 = 6/26224 there3 = 6/21 = 3/26224 there3 = 6/21 = 3/26224 there3 = 6/21 = 3/2Vec!)