人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

數(shù)據(jù)結(jié)構(gòu)與算法(C#完成)---AVLTree(二)

數(shù)據(jù)結(jié)構(gòu)與算法(C#完成)---AVLTree(二)

更新時間:2022-08-04 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):


 //---------------override--------------------
 public override void AttachKey(object _obj)
 {
     if(!IsEmpty())
         throw new Exception("My:this node must be a empty tree node!");
     this.key=_obj;
     //產(chǎn)生一個degree長的數(shù)組,并將其初始化為空樹
     this.treeList=new ArrayList();
     this.treeList.Capacity=(int)this.degree;
     for(int i=0;i<this.degree;i++)
     {
         treeList.Add(new AVLTree());
     }
     //
     this.height=0;
 } //在改動樹的結(jié)構(gòu)后平衡樹
 public override void Balance()
 {
     this.AdjustHeight();
     //大于1則說明不平衡
     if( Math.Abs(this.BalanceFactor())>1)
     {
         if(this.BalanceFactor()>0)
         {
             if (((AVLTree)this.Left).BalanceFactor()>0)
                 this.LLRotation();
             else
                 this.LRRotation();
         }
         else
         {
              if (((AVLTree)this.Right).BalanceFactor()<0)
                  this.RRRotation();
              else
                  this.RLRotation();
         }
     }
 } public int Height
 {
     get{return this.height;}
 }

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 鲜城| 宁远县| 沂水县| 永兴县| 吴忠市| 绍兴县| 滦平县| 襄汾县| 辽中县| 朝阳市| 金昌市| 衡南县| 宁远县| 肃北| 鹤峰县| 本溪市| 三明市| 洛隆县| 长海县| 建宁县| 桐柏县| 米林县| 互助| 太原市| 文登市| 宜宾县| 中阳县| 汾西县| 扶沟县| 饶河县| 黑水县| 那坡县| 来宾市| 芜湖县| 常山县| 大邑县| 公安县| 汽车| 澄江县| 鹤壁市| 土默特左旗|