Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Notes for AVL Tree

Rating
-
Sold
-
Pages
5
Uploaded on
09-04-2021
Written in
2020/2021

The notes covers insertion , searching in AVL trees. It also holds validity for rotation in AVL trees.

Institution
Course

Content preview

AVL TREES
AVL Trees abbreviated as Adelson-Velski and Landis Tree, named
after its inventors are self-balancing binary search tree. In this, the
height of left and right subtrees cannot be more than one for all
nodes. If it exceeds by 1 , rebalancing is performed through
rotations.
For example:-




The above given tree is an AVL tree as it follows the following
property:-
1. It should follow all the rules of Binary Search Tree.
2. The height of nodes should be balanced i.e. should be in
between -1 to 1(-1,0,1).
Formula for calculating the height of tree = H(r)-H(l)
H(r) = Height of right node.
H(l) = Height of left node.
Balance Factor:- h(r)-h(l)
The value of balancing factor should be -1,0,1.
How to check whether the given tree is AVL or not?
1. The height of leaf node is 0.

, 2. If a subtree is like the given figure, the height will be




If this occurs the tree is balanced and is an AVL Tree.
3. It the given situation occurs then also the tree is an AVL tree.




What if the given tree is not an AVL tree and needs to be
rebalanced and made out to an AVL Trees?
If this situation occurs, we need to perform certain rotations so
that the tree balances and transforms to an AVL tree only if the
given tree follows the criteria of Binary Search Tree. The
rotations are as follows:-
1. Left Rotations
2. Right Rotations
Left Rotations:-

Written for

Institution
Course

Document information

Uploaded on
April 9, 2021
Number of pages
5
Written in
2020/2021
Type
Class notes
Professor(s)
Geetanjali kandpal
Contains
All classes

Subjects

$20.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
geetanjalikandpal

Get to know the seller

Seller avatar
geetanjalikandpal University of Delhi
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
5 year
Number of followers
0
Documents
3
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions