data structures - Red-black trees, relation between black and red nodes -
one of questions homework find exact lower bound of
(#black nodes)/(#red nodes) in rb-tree. bound must not asymptotic. suggestions?
your appreciated.
assuming homework:
let's review properties of redblack trees wikipedia:
- ...
- the root black.
- all leaves black.
- both children of every red node black.
- ...
to lower bound on #b/#r want construct tree has many red nodes possible. (unfortunately, due 2,3,4 cannot construct red tree)
some questions worth thinking about:
- can fit more red nodes in balanced or not-so-balanced trees?
- does or odd maximal height make difference?
- given tree contains 3, 7, ..., (2^n)-1 nodes how many red ones can fit in?
Comments
Post a Comment