lec20 - Red Black Trees Colored Nodes Definition Binary...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Red Black Trees Colored Nodes Definition Binary search tree. Each node is colored red or black. Root and all external nodes are black. No root-to-external-node path has two consecutive red nodes. All root-to-external-node paths have the same number of black nodes
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Red Black Trees Colored Edges Definition Binary search tree. Child pointers are colored red or black. Pointer to an external node is black. No root to external node path has two consecutive red pointers. Every root to external node path has the same number of black pointers.
Background image of page 2
Example Red-Black Tree 10 7 8 1 5 30 40 20 25 35 45 60 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Properties The height of a red black tree that has n (internal) nodes is between log 2 (n+1) and 2log 2 (n+1) .
Background image of page 4
Properties Start with a red black tree whose height is h ; collapse all red nodes into their parent black nodes to get a tree whose node- degrees are between 2 and 4, height is >= h/ 2 , and all external nodes are at the same level.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 7 8 1 5 30 40 20 25 35 45 60 3 Properties
Background image of page 6
Properties Let h’>= h/2 be the height of the collapsed tree. Internal nodes of collapsed tree have degree
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2010 for the course COT 5536 taught by Professor Sartajsahani during the Spring '10 term at University of Florida.

Page1 / 33

lec20 - Red Black Trees Colored Nodes Definition Binary...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online