AVL Tree
Jump to navigation
Jump to search
An AVL Tree is a tree structure that ...
- See: Self-Balancing Binary Search Tree, Data Structure, Tree Height, Child Node, Tree Rotation, Red-Black Tree, Weight-Balanced Tree.
References
2014
- (Wikipedia, 2014) ⇒ http://en.wikipedia.org/wiki/AVL_tree Retrieved:2014-7-29.
- In computer science, an 'AVL tree (Adelson-Velskii and Landis' tree, named after the inventors) is a self-balancing binary search tree. It was the first such data structure to be invented. [1] In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Lookup, insertion, and deletion all take O(log n) time in both the average and worst cases, where n is the number of nodes in the tree prior to the operation. Insertions and deletions may require the tree to be rebalanced by one or more tree rotations. The AVL tree is named after its two Soviet inventors, G. M. Adelson-Velskii and E. M. Landis, who published it in their 1962 paper "An algorithm for the organization of information". [2] AVL trees are often compared with red-black trees because both support the same set of operations and take O(log n) time for the basic operations. For lookup-intensive applications, AVL trees are faster than red-black trees because they are more rigidly balanced. Similar to red-black trees, AVL trees are height-balanced. Both are in general not weight-balanced nor μ-balanced for any [math]\displaystyle{ \scriptstyle \mu\leq\tfrac12 }[/math]; [3] that is, sibling nodes can have hugely differing numbers of descendants.
- ↑ Robert Sedgewick, Algorithms, Addison-Wesley, 1983, ISBN 0-201-06672-6, page 199, chapter 15: Balanced Trees.
- ↑ English translation by Myron J. Ricci in Soviet Math. Doklady, 3:1259–1263, 1962.
- ↑ AVL trees are not weight-balanced? (meaning: AVL trees are not μ-balanced?)
Thereby: A Binary Tree is called [math]\displaystyle{ \mu }[/math]-balanced, with [math]\displaystyle{ 0 \le\mu\leq\tfrac12 }[/math], if for every node [math]\displaystyle{ N }[/math], the inequality : [math]\displaystyle{ \tfrac12-\mu\le\tfrac{|N_l|}{|N|+1}\le \tfrac12+\mu }[/math] holds and [math]\displaystyle{ \mu }[/math] is minimal with this property. [math]\displaystyle{ |N| }[/math] is the number of nodes below the tree with [math]\displaystyle{ N }[/math] as root (including the root) and [math]\displaystyle{ N_l }[/math] is the left child node of [math]\displaystyle{ N }[/math].