Advanced Data Structures - Data Structures - Lecture Slides, Slides of Data Structures and Algorithms

Some concept of Data Structures are Abstract, Balance Factor, Complete Binary Tree, Dynamically, Storage, Implementation, Sequential Search, Advanced Data Structures, Graph Coloring Two, Insertion Sort. Main points of this lecture are: Advanced Data Structures, Named After, Dynamically, Adelson-Velskii and Landis, Balance Condition, Differ, Height, Sub-Trees, Ensure the Depth, Time For Searching

Typology: Slides

2012/2013

Uploaded on 04/30/2013

dinpal
dinpal 🇮🇳

3.6

(12)

73 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AVL TREES
By Asami Enomoto
CS 146
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Advanced Data Structures - Data Structures - Lecture Slides and more Slides Data Structures and Algorithms in PDF only on Docsity!

AVL TREES

By Asami Enomoto

CS 146

AVL Tree is…

  • named after A delson- V elskii and L andis
  • the first dynamically balanced trees to be propose
  • Binary search tree with balance condition in which the sub-trees of each node can differ by at most 1 in their height

An AVL tree has the following properties:

  1. Sub-trees of each node can differ by at most 1 in their height
  2. Every sub-trees is an AVL tree

AVL tree?

YES Each left sub-tree has height 1 greater than each right sub-tree

NO Left sub-tree has height 3, but right sub-tree has height 1

Single Rotation

left sub-tree is two level deeper than the right sub-tree

move ① up a level and ② down a level

Double Rotation

Left sub-tree is two level deeper than the right sub-tree

Move ② up two levels and ③ down a level

Deletion

  • Delete
    • Imbalance at
    • Perform rotation with
  • Imbalance at
  • Perform rotation with

Key Points

  • AVL tree remain balanced by applying rotations, therefore it guarantees O(log N) search time in a dynamic environment
  • Tree can be re-balanced in at most O(log N) time