SlideShare a Scribd company logo
Data Structure and
Algorithm (CS-102)
Ashok K Turuk
Consider the insertion of following
element A, B, C, , ….,X, Y, Z into the
BST
A

B

O(N)
C

X
Y

Z
Consider the insertion of following
element Z, X, Y, , ….,C, B, A into the
BST
Z

X
Y

C
B
A

O(N)
Balanced binary tree
• The disadvantage of a binary search tree is that its
height can be as large as N-1
• This means that the time needed to perform insertion
and deletion and many other operations can be O(N)
in the worst case
• We want a tree with small height
• A binary tree with N node has height at least
(log
N)
• Thus, our goal is to keep the height of a binary search
tree O(log N)
• Such trees are called balanced binary search trees.
Examples are AVL tree, red-black tree.
AVL tree
Height of a node
• The height of a leaf is 1. The height of
a null pointer is zero.
• The height of an internal node is the
maximum height of its children plus 1
AVL tree
• An AVL tree is a binary search tree in
which
– for every node in the tree, the height of
the left and right subtrees differ by at
most 1.
– An empty binary tree is an AVL tree
AVL tree

TL left subtree of T
h(TL ) Height of the subtree TL
TR Right subtree of T
h(TR ) Height of the subtree TR
T is an AVL tree iff TL and TR are AVL
tree and |h(TL ) - h(TR ) | <= 1
h(TL ) - h(TR ) is known as balancing factor
(BF) and for an AVL tree the BF of a
node can be either 0 , 1, or -1
AVL Search Tree
(-1)
C
G (1)

(0) A
D (0)
Insertion in AVL search Tree
Insertion into an AVL search tree may
affect the BF of a node, resulting the
BST unbalanced.

A technique called Rotation is used to
restore he balance of the search tree
AVL Search Tree
(-1)
C
G (1)

(0) A
D (0)

E
AVL Search Tree
(-2)
C
(0) A

G (2)
D (-1)

E (0)
Rotation
To perform rotation – Identify a specific
node A whose BF(A) is neither 0, 1, or -1
and which is the nearest ancestor to
the inserted node on the path from the
inserted node to the root
Rotation
Rebalancing rotation are classified as LL,
LR, RR and RL
LL Rotation: Inserted node is in the left
sub-tree of left sub-tree of node A
RR Rotation: Inserted node is in the right
sub-tree of right sub-tree of node A
LR Rotation: Inserted node is in the right
sub-tree of left sub-tree of node A
RL Rotation: Inserted node is in the left
sub-tree of right sub-tree of node A
LL Rotation
(+1)

(+2)

A
(0)

BL

B

h

A
AR

Insert X into BL

c

BR

BL : Left Sub-tree of B
BR : Right Sub-tree of B
AR : Right Sub-tree of A
h : Height

(+1) B

h+1

x

BL

h

AR
c

BR

Unbalanced AVL
search tree after
insertion
LL Rotation
(+2)

(0)

A
(+1) B

h+1

x

BL

h

AR
c

BR

Unbalanced AVL
search tree after
insertion

LL Rotation

h+1

BL

B

(0)

A
x
c

h

BR
Balanced AVL
search tree after
rotation

AR
LL Rotation Example
(+1)

96
(0)
(0)

64

(+2)

96

85

90

(0)

110
(0)

(+1)

Insert 36

(+1)

64

85

90

(0)

110
(0)

(0) 36
Unbalanced AVL search
tree
LL Rotation Example
(+2)

(0)

96
(+1)
(+1)

64

85

90

(0)

110
(0)

LL Rotation

(+1)

(0) 36

85

64

(0)

96
(0)

90 (0) 110

(0) 36

Unbalanced VAL search
tree

Balanced AVL search tree
after LL rotation
RR Rotation
(-1)

(-2)

A
B (0)

h
AL

h
BL

c

BR

A

Insert X
into BR

B

AL

(-1)

c

BL

x

h+1

BR

Unbalanced AVL
search tree after
insertion
RR Rotation
(-2)

(0)

A
B

AL

(-1)

c

BL

RR Rotation

B
(0)

A

h+1

c

h

x

BR

Unbalanced AVL
search tree after
insertion

AL

BL

h+1

x

BR

Balanced AVL
search tree after
Rotation
RR Rotation Example
(-1)

34
(0)

(-2)

34
(0)

26

Insert 65

44

(0)

40

(0)

56

(0)

(-1)

26
(0)

44

40

(-1)

56

(0) 65

Unbalanced AVL search
tree
RR Rotation Example
(-2)

(-2)

34
(0)

(-1)

26
(0)

44

40

(-1)

56

44

RR
Rotation

(0)
(0)

26

(-1)

34
(0)

56

40

(0)

65

(0) 65
Balanced AVL search tree
after RR rotation
LR Rotation

(-1)

A (+1)

B
C (0)

h

h

c

BL

CL

CR

AR

(+2)

A

(-1)

B
Insert X
into CL

C

BL

x

CL

(-1)

c

CR AR

Unbalanced AVL
search tree after
insertion
LR Rotation

A (+2)

(-1)

B
(-1)

C

h
BL

x

CL

C

(0)

B

h

AR

x

BL

(-1)

A

LR Rotation

c

CR

(0)

CL

c

CR

Balanced AVL
search tree after
LR Rotation

AR
LR Rotation Example
(+1)

44
(0)
(0)

16

(+2)

44

30

39

(0)

76
(0)

Insert 37

(-1)
(+1)

16

30

39

(0)

76
(+1)

37 (0)
Unbalanced AVL search
tree
LR Rotation Example
(+2)

44
(-1)
(0)

(0)

39
(0)

30

16

76

39
37

(0)

(+1)

LR Rotation

(0)
(0)

16

30

37

(-1)

44
(0)

76
(0)

Balanced AVL search tree
RL Rotation

(-1)

A

h (0)
C
AL

(-2)

(0)

B

Insert X
into CR
c

CL

A

CR

h (-1)
C

h
BR

(+1)

AL

B

c

CL

x

CR

Unbalanced AVL
search tree after
insertion

h
BR
RL Rotation

(-2)

A

h (-1)
C
AL

B

RL Rotation
(+1)
c

CL

(0)

(+1)

x

CR

h
BR

C

(0)

B

A
c

AL

h

x

h
CL

CR

BR

Balanced AVL search
tree after RL Rotation
RL Rotation Example
(-1)

34
(0)

(-2)

34
(0)

26

Insert 41

44

(0)

40

(0)

56

(0)

(+1)

26

44

(-1)

40

(0)

56

(0) 41

Unbalanced AVL search
tree
RL Rotation Example
(-2)

34
(0)

(0)

40
(+1) RL Rotation

26
(-1)

44

(0)

40

(0)

56

(+1)

(0)

34

(0) 26 (0)

44

41

(0)

56

41

Balanced AVL search
tree
AVL Tree
Construct an AVL search tree by inserting
the following elements in the order of
their occurrence

64, 1, 14, 26, 13, 110, 98, 85
Insert 64, 1

64

(+1)

(0) 1

(0)

Insert 14

64

1

(+2)

LR

(-1)
14 (0)

(0)
1

14
(0)
64
Insert 26, 13, 110,98
(-1)

14

(-1)
(-1)
1 (0) 64
(+1)
13
(0)
110
26
(0)
98

(0)
(0)
1

14
(0)
64
Insert 85
(-1)
1

14

(-1)

(-2)

LL

(-2)

(0) 64
13
(0)
26

(+2)

110
98

85 (0)

(+1)

14

(-1)
(-1)
1 (0) 64
(0)
13
(0)
98
26
(0)
85

(0)
110
Deletion in AVL search Tree
Deletion in AVL search tree proceed the
same way as the deletion in binary
search tree
However, in the event of imbalance due to
deletion, one or more rotation need to
be applied to balance the AVL tree.
AVL deletion
Let A be the closest ancestor node on the
path from X (deleted node) to the root
with a balancing factor +2 or -2
Classify the rotation as L or R depending
on whether the deletion occurred on the
left or right subtree of A
AVL Deletion
Depending on the value of BF(B) where B
is the root of the left or right subtree
of A, the R or L imbalance is further
classified as R0, R1 and R -1 or L0, L1
and L-1.
R0 Rotation
(+1)

(+2)

A
(0)

BL

Delete node X

B

h

A

h AR
c

BR

(0)

x

BL

B
h

AR
c

BR

h -1

Unbalanced AVL
search tree after
deletion of node
x
R0 Rotation
(+2)

(-1) B

A
(0)

BL

B

h

AR
c

BR

Unbalanced AVL
search tree after
deletion of x

(+1)

A

R0 Rotation

BF(B) == 0, use
R0 rotation

BL

c

h

BR

Balanced AVL
search tree after
rotation

AR
R0 Rotation Example
(+1)

(+2)

46
(0)
(+1)

18

(0) 7

20

23

(-1)

54
(-1)

(0) 24

46
Delete 60 (0)

60

(0)

(+1)

18

(0) 7

20

23

(0)

54
(-1)

(0) 24

Unbalanced AVL search
tree after deletion
R0 Rotation Example
(+2)

(-1)

46
(0)
(+1)

18

(0) 7

20

23

(0)

54
(-1)

(0) 24

20
R0

(+1)
(0)

7

(+1)

18
(-1)

46

23

(0)
54

(0) 24
Balanced AVL search tree
after deletion
R1 Rotation
(+1)

(+2)

A
Delete node X

(+1) B

h
BL

A

h AR
c

x

h -1

BR

(+1) B

h
BL

h -1 AR
c

BR

h -1

Unbalanced AVL
search tree after
deletion of node
x
R1 Rotation
(+2)

(0)

A
(+1) B

h
BL

h -1 AR
c

BR

h -1

B

(0)

A

R1 Rotation

BF(B) == 1, use
R1 rotation

BL

c

BR

h-1 A
R

Balanced AVL
search tree after
rotation
R1 Rotation Example
(+1)

(+2)

37
(+1)
(+1)

18

(0) 16

26

28

(+1)

41
39 (0)

37
(+1)

Delete 39

26

(+1)

18

(0)

28

(0)

41
(0)

(0) 16
Unbalanced AVL search
tree after deletion
R1 Rotation Example
(+2)

(0)

37
(+1)
(+1)

18

26

(0)

41

28 (0)

26
R1 Rotation
(0)

(0)

(+1)

18

16

37

28

(0)

(0)
41

(0) 16
Balanced AVL search tree
after deletion
R-1 Rotation

(-1)

A (+1)

h-1

c

BL

CL

CR

h

A

(-1)

B

B
C (0)

(+2)

C

Delete X

(0)

h-1
c

x

AR

BL

CL

CR

Unbalanced AVL
search tree after
deletion

AR
R-1 Rotation

(-1)

A (+2)

B
h-1

h -1
C (0)

BL

CL

CR

AR

(0)

B
R -1

h -1
BL

c

(0)

BF(B) == -1,
use R-1 rotation

CL

C

(0)
c

A
h -1

CR AR

Balanced AVL
search tree after
Rotation
R-1 Rotation Example
(+1)

44
(-1)
(0)

22

(+2)

44
(-1) Delete 52

48

(0) 52
28

18
23

29

(-1)
(0)

18

22

28

23 (0)

(0)

48
(0)
29

Unbalanced AVL search
tree after deletion
R-1 Rotation Example
(+1)

44
(-1)
(0)

22

(0)

28
(-1) R-1

48

(0) 52
28

18
23

(0)
(0)

18

(0)
44

22
(0)

23

29

(0)

48

29
Balanced AVL search tree
after rotation
L0 Rotation
(-1)

(-2)

A
B (0)

h
x

AL

h
BL

A

Delete X

c

BR

h-1
AL

B
h

BL

(0)

c

BR

Unbalanced AVL
search tree after
deletion
L0 Rotation
(-1)

(+1)

A
B (0)

h -1
AL

h
BL

B

Delete X

c

BR

(-1)

AL A

h

c

(0)

BR

h-1
BL

Balanced AVL
search tree after
deletion
L1 Rotation
(-1)

(-2)

A
B (+1)

h

(0)

AL

c

C

x

h-1

CL

A

Delete X

CR

h-1

h-1
AL (0)

B

(+1)

C h-1c

BR
CL

CR

Unbalanced AVL
search tree after
deletion

BR
L1 Rotation
(-2)

(0)

A
h-1
AL

B (+1)
(0)

c

C
h-1

CL

CR

BR

L1

C

(0)

A

h-1

h-1
AL

B

(0)

h-1c

CL CR

Unbalanced AVL
search tree after
deletion

BR
L-1 Rotation
(-1)

(-2)

A
h

h-1
x

AL

B (-1)
c

BL

A

Delete X

h

BR

h-1
AL

h-1

B

(-1)

c

BL

BR

Unbalanced AVL
search tree after
deletion

h
L-1 Rotation
(-2)

(0)

A
h-1

h-1
BL

(-1)

B (-1)
c

AL

B

Delete X

A

h

BR

c

AL

h-1 B

L

h

BR

Balanced AVL
search tree after
deletion

More Related Content

What's hot

Tree in data structure
Tree in data structureTree in data structure
Tree in data structureghhgj jhgh
 
Bst(Binary Search Tree)
Bst(Binary Search Tree)Bst(Binary Search Tree)
Bst(Binary Search Tree)
Eleti Ganapathi
 
Insertion in singly linked list
Insertion in singly linked listInsertion in singly linked list
Insertion in singly linked list
Keval Bhogayata
 
Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)
United International University
 
Data Structures with C Linked List
Data Structures with C Linked ListData Structures with C Linked List
Data Structures with C Linked List
Reazul Islam
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
sagar yadav
 
Binary search tree
Binary search treeBinary search tree
Binary search tree
Kousalya M
 
UNIT III NON LINEAR DATA STRUCTURES – TREES
UNIT III 	NON LINEAR DATA STRUCTURES – TREESUNIT III 	NON LINEAR DATA STRUCTURES – TREES
UNIT III NON LINEAR DATA STRUCTURES – TREES
Kathirvel Ayyaswamy
 
Tree-In Data Structure
Tree-In Data StructureTree-In Data Structure
Tree-In Data Structure
United International University
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
Hossain Md Shakhawat
 
Queue implementation
Queue implementationQueue implementation
Queue implementation
Rajendran
 
Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]
Muhammad Hammad Waseem
 
Python SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite DatabasePython SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite Database
ElangovanTechNotesET
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
khabbab_h
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
Ninad Mankar
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
Kevin Jadiya
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
Protap Mondal
 
Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
ManishPrajapati78
 

What's hot (20)

Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
Bst(Binary Search Tree)
Bst(Binary Search Tree)Bst(Binary Search Tree)
Bst(Binary Search Tree)
 
Insertion in singly linked list
Insertion in singly linked listInsertion in singly linked list
Insertion in singly linked list
 
Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
Data Structures with C Linked List
Data Structures with C Linked ListData Structures with C Linked List
Data Structures with C Linked List
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Binary search tree
Binary search treeBinary search tree
Binary search tree
 
UNIT III NON LINEAR DATA STRUCTURES – TREES
UNIT III 	NON LINEAR DATA STRUCTURES – TREESUNIT III 	NON LINEAR DATA STRUCTURES – TREES
UNIT III NON LINEAR DATA STRUCTURES – TREES
 
Tree-In Data Structure
Tree-In Data StructureTree-In Data Structure
Tree-In Data Structure
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
 
Queue implementation
Queue implementationQueue implementation
Queue implementation
 
Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]Data Structures - Lecture 8 [Sorting Algorithms]
Data Structures - Lecture 8 [Sorting Algorithms]
 
Python SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite DatabasePython SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite Database
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
 
Disjoint sets
Disjoint setsDisjoint sets
Disjoint sets
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
 

Viewers also liked

Mca iii dfs u-4 tree and graph
Mca iii dfs u-4 tree and graphMca iii dfs u-4 tree and graph
Mca iii dfs u-4 tree and graph
Rai University
 
9.bst(contd.) avl tree
9.bst(contd.) avl tree9.bst(contd.) avl tree
9.bst(contd.) avl tree
Chandan Singh
 
The Stack And Recursion
The Stack And RecursionThe Stack And Recursion
The Stack And Recursion
Ashim Lamichhane
 
Queues
QueuesQueues
Stacks in algorithems & data structure
Stacks in algorithems & data structureStacks in algorithems & data structure
Stacks in algorithems & data structure
faran nawaz
 
Stack data structure
Stack data structureStack data structure
Stack data structureTech_MX
 
Stack
StackStack
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
Archie Jamwal
 

Viewers also liked (11)

AVL Tree
AVL TreeAVL Tree
AVL Tree
 
Mca iii dfs u-4 tree and graph
Mca iii dfs u-4 tree and graphMca iii dfs u-4 tree and graph
Mca iii dfs u-4 tree and graph
 
9.bst(contd.) avl tree
9.bst(contd.) avl tree9.bst(contd.) avl tree
9.bst(contd.) avl tree
 
The Stack And Recursion
The Stack And RecursionThe Stack And Recursion
The Stack And Recursion
 
Queues
QueuesQueues
Queues
 
Stacks in algorithems & data structure
Stacks in algorithems & data structureStacks in algorithems & data structure
Stacks in algorithems & data structure
 
Recursion
RecursionRecursion
Recursion
 
Stack data structure
Stack data structureStack data structure
Stack data structure
 
Stack
StackStack
Stack
 
Graphs ppt
Graphs pptGraphs ppt
Graphs ppt
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 

Similar to Lecture 10 data structures and algorithms

4. avl
4. avl4. avl
Avl trees
Avl treesAvl trees
Avl trees
priyapavi96
 
CS-102 AVLSv2.pdf
CS-102 AVLSv2.pdfCS-102 AVLSv2.pdf
CS-102 AVLSv2.pdf
ssuser034ce1
 
CS-102 AVLS.pdf
CS-102 AVLS.pdfCS-102 AVLS.pdf
CS-102 AVLS.pdf
ssuser034ce1
 
Avl trees
Avl treesAvl trees
Avl trees
Xad Kuain
 
Lect 13, 14 (final)AVL Tree and Rotations.pdf
Lect 13, 14 (final)AVL Tree and Rotations.pdfLect 13, 14 (final)AVL Tree and Rotations.pdf
Lect 13, 14 (final)AVL Tree and Rotations.pdf
MuhammadUmerIhtisham
 
Avl trees final
Avl trees finalAvl trees final
Avl trees final
PRAKASH RANJAN SINGH
 
Avl tree
Avl treeAvl tree
Avl tree
Van Pham
 
Data Structure and Algorithms AVL Trees
Data Structure and Algorithms AVL TreesData Structure and Algorithms AVL Trees
Data Structure and Algorithms AVL Trees
ManishPrajapati78
 
AVL Tree.pptx
AVL Tree.pptxAVL Tree.pptx
AVL Tree.pptx
Trad5
 
DS_Mod4_2.pdf
DS_Mod4_2.pdfDS_Mod4_2.pdf
DS_Mod4_2.pdf
SankarTerli
 
AVL-TREE.ppt
AVL-TREE.pptAVL-TREE.ppt
AVL-TREE.ppt
Pran K Mohanty
 
AVL tree Chanchal.pptx
AVL tree Chanchal.pptxAVL tree Chanchal.pptx
AVL tree Chanchal.pptx
ChanchalChauhan19
 
Data structures trees and graphs - AVL tree.pptx
Data structures trees and graphs - AVL  tree.pptxData structures trees and graphs - AVL  tree.pptx
Data structures trees and graphs - AVL tree.pptx
MalligaarjunanN
 
Logic microoperations
Logic microoperationsLogic microoperations
Logic microoperationsNitesh Singh
 
Adelson velskii Landis rotations based on
Adelson velskii Landis rotations based onAdelson velskii Landis rotations based on
Adelson velskii Landis rotations based on
banupriyar5
 
avl.ppt
avl.pptavl.ppt
avl.ppt
cotisa2402
 
avl.ppt
avl.pptavl.ppt
avl.ppt
plagcheck
 

Similar to Lecture 10 data structures and algorithms (20)

4. avl
4. avl4. avl
4. avl
 
Avl trees
Avl treesAvl trees
Avl trees
 
lec41.ppt
lec41.pptlec41.ppt
lec41.ppt
 
CS-102 AVLSv2.pdf
CS-102 AVLSv2.pdfCS-102 AVLSv2.pdf
CS-102 AVLSv2.pdf
 
CS-102 AVLS.pdf
CS-102 AVLS.pdfCS-102 AVLS.pdf
CS-102 AVLS.pdf
 
Avl trees
Avl treesAvl trees
Avl trees
 
Lect 13, 14 (final)AVL Tree and Rotations.pdf
Lect 13, 14 (final)AVL Tree and Rotations.pdfLect 13, 14 (final)AVL Tree and Rotations.pdf
Lect 13, 14 (final)AVL Tree and Rotations.pdf
 
Avl trees final
Avl trees finalAvl trees final
Avl trees final
 
Avl tree
Avl treeAvl tree
Avl tree
 
Data Structure and Algorithms AVL Trees
Data Structure and Algorithms AVL TreesData Structure and Algorithms AVL Trees
Data Structure and Algorithms AVL Trees
 
AVL Tree.pptx
AVL Tree.pptxAVL Tree.pptx
AVL Tree.pptx
 
DS_Mod4_2.pdf
DS_Mod4_2.pdfDS_Mod4_2.pdf
DS_Mod4_2.pdf
 
AVL-TREE.ppt
AVL-TREE.pptAVL-TREE.ppt
AVL-TREE.ppt
 
AVL tree Chanchal.pptx
AVL tree Chanchal.pptxAVL tree Chanchal.pptx
AVL tree Chanchal.pptx
 
AVL TREE PREPARED BY M V BRAHMANANDA REDDY
AVL TREE PREPARED BY M V BRAHMANANDA REDDYAVL TREE PREPARED BY M V BRAHMANANDA REDDY
AVL TREE PREPARED BY M V BRAHMANANDA REDDY
 
Data structures trees and graphs - AVL tree.pptx
Data structures trees and graphs - AVL  tree.pptxData structures trees and graphs - AVL  tree.pptx
Data structures trees and graphs - AVL tree.pptx
 
Logic microoperations
Logic microoperationsLogic microoperations
Logic microoperations
 
Adelson velskii Landis rotations based on
Adelson velskii Landis rotations based onAdelson velskii Landis rotations based on
Adelson velskii Landis rotations based on
 
avl.ppt
avl.pptavl.ppt
avl.ppt
 
avl.ppt
avl.pptavl.ppt
avl.ppt
 

More from Aakash deep Singhal

Lecture 15 data structures and algorithms
Lecture 15 data structures and algorithmsLecture 15 data structures and algorithms
Lecture 15 data structures and algorithmsAakash deep Singhal
 
Lecture 14 data structures and algorithms
Lecture 14 data structures and algorithmsLecture 14 data structures and algorithms
Lecture 14 data structures and algorithmsAakash deep Singhal
 
Lecture 13 data structures and algorithms
Lecture 13 data structures and algorithmsLecture 13 data structures and algorithms
Lecture 13 data structures and algorithmsAakash deep Singhal
 
Lecture 12 data structures and algorithms
Lecture 12 data structures and algorithmsLecture 12 data structures and algorithms
Lecture 12 data structures and algorithmsAakash deep Singhal
 
Lecture 11 data structures and algorithms
Lecture 11 data structures and algorithmsLecture 11 data structures and algorithms
Lecture 11 data structures and algorithmsAakash deep Singhal
 
Lecture 9 data structures and algorithms
Lecture 9 data structures and algorithmsLecture 9 data structures and algorithms
Lecture 9 data structures and algorithmsAakash deep Singhal
 
Lecture 8 data structures and algorithms
Lecture 8 data structures and algorithmsLecture 8 data structures and algorithms
Lecture 8 data structures and algorithmsAakash deep Singhal
 
Lecture 7 data structures and algorithms
Lecture 7 data structures and algorithmsLecture 7 data structures and algorithms
Lecture 7 data structures and algorithmsAakash deep Singhal
 
Lecture 6 data structures and algorithms
Lecture 6 data structures and algorithmsLecture 6 data structures and algorithms
Lecture 6 data structures and algorithmsAakash deep Singhal
 
Lecture 5 data structures and algorithms
Lecture 5 data structures and algorithmsLecture 5 data structures and algorithms
Lecture 5 data structures and algorithmsAakash deep Singhal
 
Lecture 4 data structures and algorithms
Lecture 4 data structures and algorithmsLecture 4 data structures and algorithms
Lecture 4 data structures and algorithmsAakash deep Singhal
 
Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsAakash deep Singhal
 
Lecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsLecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsAakash deep Singhal
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsAakash deep Singhal
 
Lecture 16 data structures and algorithms
Lecture 16 data structures and algorithmsLecture 16 data structures and algorithms
Lecture 16 data structures and algorithmsAakash deep Singhal
 

More from Aakash deep Singhal (16)

Subsidence in coal mines
Subsidence in coal minesSubsidence in coal mines
Subsidence in coal mines
 
Lecture 15 data structures and algorithms
Lecture 15 data structures and algorithmsLecture 15 data structures and algorithms
Lecture 15 data structures and algorithms
 
Lecture 14 data structures and algorithms
Lecture 14 data structures and algorithmsLecture 14 data structures and algorithms
Lecture 14 data structures and algorithms
 
Lecture 13 data structures and algorithms
Lecture 13 data structures and algorithmsLecture 13 data structures and algorithms
Lecture 13 data structures and algorithms
 
Lecture 12 data structures and algorithms
Lecture 12 data structures and algorithmsLecture 12 data structures and algorithms
Lecture 12 data structures and algorithms
 
Lecture 11 data structures and algorithms
Lecture 11 data structures and algorithmsLecture 11 data structures and algorithms
Lecture 11 data structures and algorithms
 
Lecture 9 data structures and algorithms
Lecture 9 data structures and algorithmsLecture 9 data structures and algorithms
Lecture 9 data structures and algorithms
 
Lecture 8 data structures and algorithms
Lecture 8 data structures and algorithmsLecture 8 data structures and algorithms
Lecture 8 data structures and algorithms
 
Lecture 7 data structures and algorithms
Lecture 7 data structures and algorithmsLecture 7 data structures and algorithms
Lecture 7 data structures and algorithms
 
Lecture 6 data structures and algorithms
Lecture 6 data structures and algorithmsLecture 6 data structures and algorithms
Lecture 6 data structures and algorithms
 
Lecture 5 data structures and algorithms
Lecture 5 data structures and algorithmsLecture 5 data structures and algorithms
Lecture 5 data structures and algorithms
 
Lecture 4 data structures and algorithms
Lecture 4 data structures and algorithmsLecture 4 data structures and algorithms
Lecture 4 data structures and algorithms
 
Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithms
 
Lecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsLecture 2 data structures and algorithms
Lecture 2 data structures and algorithms
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
 
Lecture 16 data structures and algorithms
Lecture 16 data structures and algorithmsLecture 16 data structures and algorithms
Lecture 16 data structures and algorithms
 

Recently uploaded

Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 

Recently uploaded (20)

Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 

Lecture 10 data structures and algorithms