【问题标题】:Is there a Left,Right,Right,Right rotation in AVL tree for balancing?AVL 树中是否存在左、右、右、右旋转以进行平衡?
【发布时间】:2020-04-30 21:46:21
【问题描述】:

我有以下键(字符串类型)。它们按此顺序一次插入一个,

know->world->state->agent->estimate->figure->compute->symbols->bayes->model

我在添加数字时遇到困难。我已经包括了“字符串[平衡因子]” 如果我做错了什么,有人可以指导我吗?

            state[2]
              /\
             /  \
            /    \
    estimate[-1] world[0]
        /\
       /  \
      /    \
 agent[0] know[1]
           /
          /
       figure[0]

【问题讨论】:

    标签: algorithm data-structures binary-search-tree avl-tree


    【解决方案1】:

    你的树的结构看起来不错。您只需执行旋转以使其平衡。

    作为参考,this website 应该可以帮助您可视化 AVL 树中的插入和删除

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多