权重平衡树的确切定义是什么?

What is the exact definition of a Weight balanced tree?

权重平衡树有很多定义。我很困惑应该遵循哪一个,很难理解给出的定义。

A node is balanced if weight[n.left] ≥ weight[n] and weight[n.right] ≥ weight[n]

Number of nodes in the left and right sub tree must be equal

A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the right sub tree.

谁能给我解释一下哪个是正确的?

据我了解,wbt 中节点 n 的余额 p()

给出
p(n) = s(n.l)/s(n) = 1 - s(n.r)/s(n)

其中 s 是后代叶子的数量。您现在可以开始使用旋转和双旋转操作来重新平衡树。现在,如果您有偶数个叶子,那么对于每个节点,左侧和右侧节点中的子节点数相等的说法是正确的。这仅适用于平衡的 wbt。这并不总是可能的,如果你有 6 个叶子,你如何平衡它以使该声明成立?

重新平衡降低了 wbt 的高度。

示例:您有一个 wbt,左节点有 100 万个叶子,右节点有几个叶子。您现在可以开始旋转叶子,使左子树中的叶子数为

at least half and at most twice the number of nodes in the right sub tree

一个说法是:

The tree is of bounded balance a if for every node

a <= p(n) <= 1-a