Search code examples
binary-treetree-balancing

Left balanced binary trees


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 :-).


Solution

  • 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:

    enter image description here

    This tree is balanced, but not left-balanced. If node 67 were removed, however, the tree would be left-balanced.