0% found this document useful (0 votes)
31 views2 pages

Deletions From A Red-Black Tree

The document describes deletions from a red-black tree with initial keys of 1, 3, 5, 7, 9. a) Deleting key 1 requires rotating the tree to the left. b) Deleting key 3 requires recoloring nodes and rotating right. c) Deleting key 5 requires rotating left twice. d) Deleting key 7 requires rotating right. e) Deleting key 9 requires rotating left.

Uploaded by

Ani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

Deletions From A Red-Black Tree

The document describes deletions from a red-black tree with initial keys of 1, 3, 5, 7, 9. a) Deleting key 1 requires rotating the tree to the left. b) Deleting key 3 requires recoloring nodes and rotating right. c) Deleting key 5 requires rotating left twice. d) Deleting key 7 requires rotating right. e) Deleting key 9 requires rotating left.

Uploaded by

Ani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Deletions from a Red-Black Tree

Deletions: Removing the 1, 3, 5, 7, 9 keys from the following RB-tree.

2 6

1 3 5 8

7 9

10

a) 1

6
4
4 8
2 6

2 5 7 9
1 3 5 8

9 3 10
7

10

b) 3

6
6
4 8
4 8

2 5 7 9
2 5 7 9

10
3 10
Deletions from a Red-Black Tree – (2)

c) 5
6 6

8 4 8
4

5 7 9 2 7 9
2

10 10

d) 7

6 6

4 8 4 9

2 7 9 2 8 10

10

e) 9
6 6

4 9 4 10

2 8 10 2 8

2
Armen Kostanyan

You might also like