I am reading a book on data structures and it says that a left balanced binary tree is a tree in which the leaves only occupy the leftmost positions in the last level.
This seemed a little vague to me. Does this mean that leaves are only on the left side of a root and are distributed throughout the whole level, or leave exists only on the left side of the entire tree. Exactly what constitute left balanced?
I am not sure if my guess even covers any of the answer, so if anyone could help, it would be greatly appreciated :-).
You can think of a left-balanced binary tree as a balanced binary tree where the left sub-tree of each node is filled before the right sub-tree. In more informal terms, this is a tree wherein the nodes at the bottom-most level are all on the left side of the entire tree.
Take this tree for example:
This tree is balanced, but not left-balanced. If node 67 were removed, however, the tree would be left-balanced.
It seems to me that the definition of left balanced binary tree is the same of complete binary tree.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With