Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,如果我们在一个左分支上按降序排列的值为 10、9 ... 1 的节点,我们如何在树上执行旋转以使其成为平衡的 AVL 树?我正在考虑重复单次右转,但有人可以在这里显示步骤顺序吗?
在根部进行旋转,直到 5 位于顶部。这棵树现在是一个倒置的 V。现在对两个子树中的每一个执行类似的操作,依此类推。