cool!
for some explantion:
red black trees are optimal search trees
no matter how many nodes you dd the hieght will always be as optimal as you can have, you might ask, why do i want an optimal hieght?
well when you are searching the tree your search time is dictated by how high your tree is so lower hieght is better.
a red black trees hieght is at worse 2*log(n+1) and can always be searched in O(log(n)) steps where n is the number of nodes in a tree. a normal binary tree has a worse case search time of O(n) steps soo you can see the great advantage of this tree!
for some explantion:
red black trees are optimal search trees
no matter how many nodes you dd the hieght will always be as optimal as you can have, you might ask, why do i want an optimal hieght?
well when you are searching the tree your search time is dictated by how high your tree is so lower hieght is better.
a red black trees hieght is at worse 2*log(n+1) and can always be searched in O(log(n)) steps where n is the number of nodes in a tree. a normal binary tree has a worse case search time of O(n) steps soo you can see the great advantage of this tree!
