AVL Trees and B Trees

AVL Trees and B Trees - CSC2100A Tutorial Trees AVL Trees...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSC2100A Spring 2006-2007 CSC2100A Tutorial Trees 2 Spring 2006/2007 AVL Trees, B-Trees
Image of page 1

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

View Full Document Right Arrow Icon
2 CSC2100A Spring 2006-2007 AVL Trees An AVL (Adelson-Velskii and Landis) tree is a binary search tree with a balance condition. An AVL tree is identical to a binary search tree, except that for every node in the tree, the height of the left and right subtrees can differ by at most 1. With an AVL tree, all the tree operations can be performed in O (log n ) time, except insertion.
Image of page 2
3 CSC2100A Spring 2006-2007 Trees - AVL trees LL (Single rotation): a node (k2) with left child (k1) k1 X Y k2 Z Y Z k1 X k2
Image of page 3

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

View Full Document Right Arrow Icon