I am studying red black trees from CLRS. I have 2 questions about the part where properties of red-black trees are discussed. The passage from CLRS is as follows:
A red-black tree is a binary tree that satisfies the following red-black properties:
Every node is either red or black
The root is black
Every leaf(NIL) is black
If a node is red, then both its children are black
For each node, all simple paths from the node to descendant leaves contain the same number of black nodes
First of all, it says a red-black tree is a binary tree. Why didn't they say a red-black tree is a binary search tree. I thought the whole purpose of a red-black tree is to maintain the balance in a search tree to insure logN operations. Second, why is the leaf in a red-black tree the NIL?
In regular binary trees, we're used to this:
4
5 7
3 2 Nil Nil
Nil Nil Nil Nil
In this case, 3, 2, and 7 are the leaves. Why are the leaves depicted as the Nil's in CLRS?