国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

數(shù)據(jù)結(jié)構(gòu)與算法(C#實(shí)現(xiàn))系列---樹(三)

2024-07-21 02:17:24
字體:
供稿:網(wǎng)友
 

數(shù)據(jù)結(jié)構(gòu)與算法(c#實(shí)現(xiàn))系列---樹(三)

 heavenkiller(原創(chuàng))

 

         //overwrite object.equals() ---  reference  type   realization

         public override bool equals(object _obj)

         {

              if( _obj==null )

                   return false;//因?yàn)閠his不可能為null

              if( ! (this.gettype()==_obj.gettype()) )

                   return false;//類型不相等也不相等

              tree tmpobj=(tree)_obj;

              //比較引用成員

              if( !object.equals(this.key,tmpobj.key) )

                   return false;

             

              //比較值類型成員

              if( !this.degree.equals(tmpobj.degree) )

                   return false;

              //if( !this.height.equals(tmpobj.height) )

                   //return false;

 

              return true;

         }

         //在此重載 ==,!= 后, 在以后繼承的類中不必實(shí)現(xiàn)了

         public static bool operator==(tree _treea,tree _treeb)

         {

              return object.equals(_treea,_treeb);

         }

         public static bool operator!=(tree _treea,tree _treeb)

         {

              return !(_treea==_treeb);

         }

        

 

    

 

    

    

         #region icomparable 成員

 

         public virtual int compareto(object obj)

         {

              // todo:  添加 tree.compareto 實(shí)現(xiàn)

              return 0;

         }

 

         #endregion

    

     }

}

中國最大的web開發(fā)資源網(wǎng)站及技術(shù)社區(qū),
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 紫阳县| 宣汉县| 太和县| 含山县| 东乡族自治县| 昭觉县| 玉环县| 无极县| 鄂托克前旗| 武城县| 上杭县| 韶山市| 石河子市| 博客| 清丰县| 彭泽县| 桃园县| 中超| 红原县| 塔河县| 福州市| 呼图壁县| 和政县| 平阳县| 柳河县| 绍兴县| 高唐县| 富川| 遵化市| 会泽县| 逊克县| 望奎县| 合作市| 东港市| 舞阳县| 栾川县| 万载县| 安塞县| 昌平区| 双城市| 嘉禾县|