- Weight-balanced tree
A weight-balanced binary tree is a
binary tree where the most probable item is the root item. The leftsubtree consists of items less than the root items ranking, not its probability. The right sub tree consists of items greater than the root items ranking.The Diagram
In the diagram to the right the root node is at the top of the tree because its probability is the greatest in the tree. Each node has a probability or activity count associated with it. The number next to the root node is its probability or activity count for that node. The left sub tree begins with A because A is less than G and A has the highest probability or activity count of the left sub tree nodes. The right sub tree begins with N because it is greater than G and has the highest probability/activity count of all the right sub tree nodes
Timing Analysis
A weight balanced tree gives close to optimal values for the expected length of successful search calculations. From the above example we get
ELOSS = 2*0.17 + 5*0.03 + 4*0.09 + 3*0.12 + 1*0.20 + 3*0.11 + 3*0.10 + 2*0.18
ELOSS = 2.4
See also
*
Binary tree
*AVL tree
*B-tree
*Binary space partitioning
*Red-black tree References
*
Jean-Paul Tremblay and Grant A. Cheston . "Data Structures and Software Development in an object-oriented domain", Eiffel Edition. Prentice Hall, 2001. ISBN 0-13-787946-6.
Wikimedia Foundation. 2010.