This preview shows pages 1–5. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Performance
Consider a dictionary with n items implemented by means of
a binary search tree of height h
the space used is O(n)
methods find, insert and remove take O(h) time The height h is O(n) in the worst case and O(log n) in the
best case
It is thus worthwhile to balance the tree (next topic)! CSE 2011
Prof. J. Elder  11  Last Updated: 3/3/10 6:14 PM AVL Trees
6 v 8 3
z
4 CSE 2011
Prof. J. Elder  12  Last Updated: 3/3/10 6:14 PM AVL Trees
The AVL tree is the first balanced binary search tree ever
invented.
It is named after its two inventors, G.M. AdelsonVelskii
and E.M. Landis, who published it in their 1962 paper
"An algorithm for the organization of information.” CSE 2011
Prof. J. Elder  13  Last Updated: 3/3/10 6:14 PM AVL Trees
AVL trees are balanced.
An AVL Tree is a binary search tree in which the
heights of siblings can differ by at most 1. height
0
0 0
0
0 CSE 2011
Prof. J. Elder 0 0  14  0 0
Last Updated: 3/3/10 6:14 PM Height of an AVL Tree
Claim: The height of an AVL tree storing n keys is O(log n). CSE 2011
Prof. J. Elder  15  Last Updated: 3/3/10 6:14 PM ...
View Full
Document
 Fall '11
 Elder
 Binary Search, Data Structures

Click to edit the document details