Search Trees_Part_3

Search Trees_Part_3 - Performance Consider a dictionary...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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. Adelson-Velskii 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

Page1 / 5

Search Trees_Part_3 - Performance Consider a dictionary...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online