algorithm - How to save the memory when storing color information in Red-Black Trees? -
i've bumped question @ 1 of coursera algorithms course , realized have no idea how that. still, have thoughts it. first thing comes mind using optimized bit set (like java's bitset) mapping node's key -> color. so, need allocate 1 bit set whole tree , use color information source. if there no duplicatate elements in tree - should work.
would happy see other's ideas task.
use least significant bit of 1 of pointers in node store color information. node pointers should contain addresses on platforms. see details here.
Comments
Post a Comment