为什么是红黑树而不是绿黄树?

来源:互联网 发布:网络交友的危害 编辑:程序博客网 时间:2024/05/01 08:44

        红黑树已经被大家说烂了, 我的疑问是: 为什么是红黑树而不是绿黄树?

        这是个无用但有趣的问题!


        直接看维基百科吧:

      In 1972, Rudolf Bayer[4] invented a data structure that was a special order-4 case of a B-tree. These trees maintained all paths from root to leaf with the same number of nodes, creating perfectly balanced trees. However, they were not binary search trees. Bayer called them a "symmetric binary B-tree" in his paper and later they became popular as 2-3-4 trees or just 2-4 trees.[5]

In a 1978 paper, "A Dichromatic Framework for Balanced Trees",[6] Leonidas J. Guibas and Robert Sedgewick derived the red-black tree from the symmetric binary B-tree.[7] The color "red" was chosen because it was the best-looking color produced by the color laser printer available to the authors while working at Xerox PARC.[8] Another response from Guibas states that it was because of the red and black pens available to them to draw the trees.[9]




原创粉丝点击