数据结构和C#算法实现---AVLTree(2)

数据结构和C#算法实现---AVLTree(2)
/ / ---------------重写--------------------
公共覆盖空洞attachkey(对象_obj)
{
如果(!IsEmpty())
抛出新的异常():这个节点必须是空树节点!;
这_obj关键=;
有一个长数组,该数组初始化为空树。
这种树形=新的ArrayList();
这个树形。能力=(int)this.degree;
为(int = i 0;i {)
(新添加的树形,实现());
}

这个高度= 0;
}

树后结构平衡树的变化
公共覆盖空值平衡()
{
This.AdjustHeight ();
不平衡大于1 /。
如果(Math.Abs(this.balancefactor())>1)
{
如果(this.balancefactor()> 0)
{
如果((((( avltree),左),BalanceFactor()> 0)
this.llrotation();
其他的
this.lrrotation();
}
其他的
{
如果((((( avltree),右),BalanceFactor()()this.rrrotation;
其他的
this.rlrotation();
}
}
}

public int高度
{
获取{这个高度。}
}

tag:算法实现数据结构电脑软件AVLTree

相关内容