Height == 0 indicates a leaf
Height == 1 indicates the parent of a leaf
etc.
"height" uses the same memory footprint as "leaf" and requires the same number of CPU instructions to test for leafiness.
"height" will speed up a few operations slightly. Specifically, the extend operation would become O(|log n - log k|), an improvement over O(log n + log k). Many other operations internally use "extend" and would get a small constant-factor speedup.
Finally, "height" will allow for additional error-checking in debug builds, since we can check the following invariant: the height of any non-leaf node's children must equal the node's height minus one.
Height == 0 indicates a leaf Height == 1 indicates the parent of a leaf etc.
"height" uses the same memory footprint as "leaf" and requires the same number of CPU instructions to test for leafiness.
"height" will speed up a few operations slightly. Specifically, the extend operation would become O(|log n - log k|), an improvement over O(log n + log k). Many other operations internally use "extend" and would get a small constant-factor speedup.
Finally, "height" will allow for additional error-checking in debug builds, since we can check the following invariant: the height of any non-leaf node's children must equal the node's height minus one.