Algorithm Analysis (CSC 301 2015F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Outline] [EBoard] [Reading] [Lab] [Assignment]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Algorist]
Related Courses: [Walker (2014F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker]
Overview
We had
a (N+2)
/ \
/ \
b(N+1) C(N)
/ \
/ \
D(N) E(N)
We added a node below D which increased its height by 1.
a (N+3)
/ \
/ \
b(N+2) C(N)
/ \
/ \
D(N+1) E(N)
Questions
How imbalanced can such a tree be? How do we compute the black height of a node?
We insert in the normal bst model. We color the new leaf red and then clean up.
Examples of things we'll have to deal with. Assume b and r are the old black and red nodes, and R is the new red node.
b
/ \
/ \
b b
/ \
/ \
r r
/
/
R