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:

  1. ...
  2. the root black.
  3. all leaves black.
  4. both children of every red node black.
  5. ...

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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -