Invalid tree after delete
db7 opened this issue · comments
If condenseTree reduces the depth of the tree, the height variable does not get updated. If fact, height never decreases. It is only modified by increment, when a split occurs at the root. The result is that, by deleting noes, the tree may become invalid.
PR #11 overwrites the tree height with the root node level after deleting nodes. It also includes a simple test case that fails without the fix.
thanks for the pull request!