Solutions of Final 3

Solutions of Final 3 - re-coloring will occur and the root will be red(violation of red black property Step 2 The root is recolored to be black As

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Solutions of VT MENA Final 2 Question 3 a. Yes, this is a valid red black tree because it satisfies all the properties of the red black tree. After deleting 1 The nodes that will be colored with red will be as shown in the figure below. This change in color occurs to maintain the black height property of the red black tree. a. Step 1 When the new node is inserted, both its parent and uncle are red, so
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: re-coloring will occur, and the root will be red (violation of red black property). Step 2 The root is recolored to be black. As there were only a root with its 2 children, now the new inserted node will take its place in the tree according to its value. But no rotations are needed as all the properties of the red black tree are reserved....
View Full Document

This note was uploaded on 11/09/2010 for the course CS 11841 taught by Professor Dr.ayman during the Spring '09 term at Alexandria University.

Ask a homework question - tutors are online