CS223-0207-RBTree

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

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

CS223 Advanced Data Structures and Algorithms 1 Red-Black Tree Red-Black Tree Neil Tang Neil Tang 02/07/2008 02/07/2008

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

View Full Document
CS223 Advanced Data Structures and Algorithms 2 Class Overview Class Overview Definition Tree height Rotation and color flip Insert Delete
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.

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

View Full Document
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.
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
Ask a homework question - tutors are online