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 DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: EXAMPLE (DONE IN CLASS) AVL Trees: Efficiency b It can be shown that the worst case height of an AVL tree is at most 44% larger than the minimum possible for a BST (i.e. approximately 1.44lgn) Time Complexity of Basic AVL Tree Operations b Insert s Maximum possible number of rotations = 1 b Delete s Maximum possible number of rotations = lg( n ) b Worst case times s Search: O(lg n ) s Insert: O(lg n ) s Delete: O(lg n ) Conclusions b AVL trees maintain balance of BSTs while they are being created via insertions of data b An alternative approach is to have trees that readjust themselves when data is accessed, making often accessed data items move to the top of the tree. We won’t be covering these (splay trees)...
View
Full Document
 Spring '09
 Dr.IkerGondraLuja
 Data Structures, Splay tree, Tree rotation, 44%

Click to edit the document details