AVL树左节点是否总是小于当前节点?
Does AVL tree left node is always smaller than current node?
AVL树的定义是"keep Balance Factor smaller than 1"。
(平衡因子的定义是 |left child height-right child height| )
没有条件全部左边child小于当前节点,右边全部child大于当前节点。
但是,维基百科和一些 youtube 视频中关于 AVL 树的每个示例都显示 "left childs are~ and right childs~bigger"。
为什么?只是巧合?或者AVL树需要"left~and right~"?
我明白了。
因为它是"search"树,所以当我插入项目作为阳极时,它必须遵循规则"left thing is smaller"。通过根到叶。
AVL树的定义是"keep Balance Factor smaller than 1"。 (平衡因子的定义是 |left child height-right child height| )
没有条件全部左边child小于当前节点,右边全部child大于当前节点。
但是,维基百科和一些 youtube 视频中关于 AVL 树的每个示例都显示 "left childs are~ and right childs~bigger"。
为什么?只是巧合?或者AVL树需要"left~and right~"?
我明白了。
因为它是"search"树,所以当我插入项目作为阳极时,它必须遵循规则"left thing is smaller"。通过根到叶。