COP 3503 Computer Science II Fall 2005 Week Eight - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

COP 3503 Computer Science II Fall 2005 Week Eight

Description:

Named after its discoverers, Adelson-Velskii and Landis) It is a BST with balance conditions. ... An AVL tree of height H has at least FH 3-1 nodes, where Fi is ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 7
Provided by: stude1353
Category:
Tags: cop | computer | eight | fall | landis | science | week

less

Transcript and Presenter's Notes

Title: COP 3503 Computer Science II Fall 2005 Week Eight


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 FH3-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.
Write a Comment
User Comments (0)
About PowerShow.com