【发布时间】:2012-08-06 13:09:48
【问题描述】:
为什么rope上的维基百科文章中有duplicate nodes之类的9、1和6?
是我遗漏了什么,还是那些节点完全冗余?
【问题讨论】:
标签: algorithm data-structures redundancy recursive-datastructures
为什么rope上的维基百科文章中有duplicate nodes之类的9、1和6?
是我遗漏了什么,还是那些节点完全冗余?
【问题讨论】:
标签: algorithm data-structures redundancy recursive-datastructures
它们(具有单个孩子的非叶节点)似乎完全没有意义。 linked to paper from boehm et al 中似乎没有任何等效的东西(他们使用“正常”平衡树)。
它们对我来说毫无意义。
【讨论】:
来自文章:
Each node has a "weight" equal to the length of its string plus the sum of all the weights in its left subtree.
这些数字似乎代表了节点的权重,基于其子节点的大小。因此,值为6 的两个节点不必具有相同的值。有一个权重为 6 的 Hello_ 和一个权重为 6 的 _Simon。
编辑
对于非叶子值,重复项似乎在那里使叶子处于相同的深度。
【讨论】:
这些节点可能在删除后出现。最终你会想要重新平衡,所以每个节点都有两个子节点(或叶子),并且每个分支的深度都是相同的。
【讨论】: