1 / 6

COP 3503 - Computer Science II (Fall 2005) Week Eight

COP 3503 - Computer Science II (Fall 2005) Week Eight. By Yunjun Zhang. AVL tree. Named after its discoverers, Adelson-Velskii and Landis) It is a BST with balance conditions. Depth log(N) Definition BST

Download Presentation

COP 3503 - Computer Science II (Fall 2005) Week Eight

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COP 3503 - Computer Science II (Fall 2005)Week Eight By Yunjun Zhang

  2. AVL tree • Named after its discoverers, Adelson-Velskii and Landis) • It is a BST with balance conditions. • Depth log(N) • Definition • BST • For any node in the tree, the difference between the height of left subtree and right subtree is at most 1

  3. AVL tree • Properties • An AVL tree of height H has at least FH+3-1 nodes, where Fi is the ith Fibonacci number. • Proof : on board.

  4. AVL tree • Ideas behind AVL tree • Balance conditions are violated when insertion or deletion operate. • Rotations must be performed to maintain the balance condition. • Single/Double rotation. Symmetric for left or right version.

  5. AVL tree • Insertion • Single Rotation • Double Rotation • On board

  6. AVL tree • Deletion • Delete the node as in a binary search tree. • The node deleted will be either a leaf or have just one subtree.

More Related