Single Rotation - 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: Single Rotation, History, Double Rotation, Time Complexity, Usage, Binary Search, Balance Condition, Depth, Ever Node, Right

Typology: Slides

2012/2013

Uploaded on 04/30/2013

patel
patel 🇮🇳

3.8

(15)

80 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AVL Trees Introduction
4.4 AVL trees
History
Single Rotation
Double Rotation
Time Complexity
Usage
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

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

AVL Trees Introduction

  • 4.4 AVL trees

History Single Rotation Double Rotation Time Complexity Usage

History

  • An AVL (Adelson – Velskii and Landis) tree is a binary search tree with a balance condition.
  • A balance condition must be maintained and this ensures that the depth of the tree is O(log N).
  • ALV tree is a binary tree however we take into consideration that ever node in the tree the height of the left and the right sub tree can differ by at most 1.

Single Rotation

  • The book covers this point very clearly. page 120

Single rotation cont..

Perform Single Rotation

Example of Single Rotation

Double Rotation

  • Figure 4.34 in the book page

Double Rotation cont…

Double Rotation

Double Rotation cont…

Time Complexity

  • I would recommend that you go to this site to

better understand the time complexity, as well as a few more ideas on AVL trees.

  • http://www.ecf.utoronto.ca/apsc/courses/ece

242/2004spring/notes/bst2.pdf

Before the quiz

  • Insert these numbers into a AVL tree.
  • Remember AVL tree is a binary search tree but a tree that is balanced.
  • Important this is the same when you insert a node or when you delete a node.
  • Hence the difference of left sub tree and the right sub tree should be no more than h = 1.
  • Practice these inputs because we might have a quiz today .

Practice cont…

  • Here is the final tree!!!

• THE END