Tree - Balanced and unbalanced

1 - About

In balanced tree (balanced/standard), the branches of the tree all descend to the same level, with each member's parent being at the level immediately above the member. An common example of a balanced hierarchy is one that represents time, where the depth of each level (year, quarter, and month) is consistent.

3 - Unbalanced

A tree where the leaves do not have the same depth.

For example, an organization might choose to have data for the current month at the day level, data for the previous year at the month level, and data for the previous five years at the quarter level.

Unbalanced hierarchies includes levels that have a consistent parent-child relationship, but have logically inconsistent levels. The hierarchy branches can also have inconsistent depths. An example of an unbalanced hierarchy is an organization chart, which show reporting relationships among employees in an organization. The levels within the organizational structure are unbalanced, with some branches in the hierarchy having more levels than others.

In an unbalanced hierarchy, null values can appear on the lower levels of the hierarchy. A parent member's children will always be in the level below that of the parent. In this hierarchy, the levels do not provide a meaningful context to its members - Washington DC is at the same level as CA in this example. A better example of an unbalanced hierarchy might be an organizational chart.

Level 1 Level 2 Level 3
USA CA San Francisco
USA CA Los Angeles
USA Washington DC <NULL>
Vatican City Vatican City <NULL>
data/type/tree/balanced.txt ยท Last modified: 2017/09/13 16:14 by gerardnico