I was reading about Red Black Trees, and I understand that nodes can either be red or black. The rules say:
1) Every node has a color - either red or black.
2) Root of tree is always black.
3) There are no two adjacent red nodes (A red node cannot have a red parent or red child)
4) Every path from a node (including root) to any of its descendant NULL node has the same number of black nodes.
There is no description of what nodes should be coded as red? I understand that the tree can have all black nodes, but what I don't understand is that when should we mark a node as red?
I would also like to understand the reasoning behind this colour coding. I know that an RB tree is basically a self-balancing tree, but I want to understand how this binary colour coding helps in that?