Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I just read your comment about red/black, and I must confess, until this point I would have agreed that it was meaningless. However, I just looked over the definition of the data structure, and I think I can propose better names.

Black nodes are 'counted' nodes, whereas red are 'uncounted'. Uncounted nodes may sit sandwiched between counted nodes, but are not allowed to follow each other... Because relaxing that rule could lead to an explosion of uncounted nodes.

Remember that the length of the path, in terms of counted nodes, to every leaf is the same. Because the uncounted nodes may be sandwiched between those counted nodes, this gives us the property we want that the length of the path of actual nodes, counted and uncounted, on the longest path is never more than twice that of the shortest path. The longest path can have every layer be a counted-uncounted sandwich, while the shortest will only have counted nodes.

I felt like changing the name added something.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: