I know that a Red-Black Tree is just a balanced binary search tree. So I computed the average search cost(basically the number of comparisons) for data sets with the number of elements being 2^n. The data was designed in such a way that it would form a perfect binary search tree. However, after calculating the average cost, I realized that the computed average search costs for the Red-black tree is slightly higher that for the perfectly balanced binary search trees. Here is my table:
# of elements Binary S. Tree Red-Black Tree
1 | 1 | 1
3 | 1.66667 | 1.6667
7 | 2.42857 | 2.71429
15 | 3.26667 | 3.4
31 | 4.16129 | 4.48387
63 | 5.09524 | 5.50794
127 | 6.05512 | 6.44882
255 | 7.03137 | 7.31373
511 | 8.01761 | 8.40509
1023 | 9.00978 | 9.45357
2047 | 10.0054 | 10.4919
4095 | 11.0029 | 11.5314
I have two questions: How do you justify that and also is there a lower bound for on the computed average costs for Red-Black Trees?