Comparison To Other Structures
Both AVL trees and red-black trees are self-balancing binary search trees, so they are very similar mathematically. The operations to balance the trees are different, but both occur in O(log n) time. The real difference between the two is the limiting height. For a tree of size :
- An AVL tree's height is strictly less than:
where is the golden ratio.
- A red-black tree's height is at most
AVL trees are more rigidly balanced than red-black trees, leading to slower insertion and removal but faster retrieval.
Read more about this topic: AVL Tree
Famous quotes containing the words comparison and/or structures:
“The difference between human vision and the image perceived by the faceted eye of an insect may be compared with the difference between a half-tone block made with the very finest screen and the corresponding picture as represented by the very coarse screening used in common newspaper pictorial reproduction. The same comparison holds good between the way Gogol saw things and the way average readers and average writers see things.”
—Vladimir Nabokov (18991977)
“The American who has been confined, in his own country, to the sight of buildings designed after foreign models, is surprised on entering York Minster or St. Peters at Rome, by the feeling that these structures are imitations also,faint copies of an invisible archetype.”
—Ralph Waldo Emerson (18031882)