CS223-0207-RBTree

CS223-0207-RBTree - Red-Black Tree Neil Tang CS223 Advanced...

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

View Full Document Right Arrow Icon
CS223 Advanced Data Structures and Algorithms 1 Red-Black Tree Red-Black Tree Neil Tang Neil Tang 02/07/2008 02/07/2008
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS223 Advanced Data Structures and Algorithms 2 Class Overview Class Overview Definition Tree height Rotation and color flip Insert Delete
Background image of page 2
CS223 Advanced Data Structures and Algorithms 3 Definition Definition A red-black tree is a special binary search tree in which every node is either red or black; the root is black; every leaf (null) is black; if a node is red, then both its children are black; every simple path from a node to a descendant leaf contains the same number of black nodes.
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Height Height Theorem : A red-black tree with N nodes has height at most 2log(N+1). (pp.274 Cormen’s book) Experiments suggests that the average red-black tree is about as deep as an average AVL tree. The rotation happens less frequently.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/17/2008 for the course CS 223 taught by Professor Tang during the Spring '07 term at MSU Bozeman.

Page1 / 14

CS223-0207-RBTree - Red-Black Tree Neil Tang CS223 Advanced...

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

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