六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

數(shù)據(jù)結(jié)構(gòu)與算法(C#完成)系列---演示篇(3)

[摘要]數(shù)據(jù)結(jié)構(gòu)與算法(C#實(shí)現(xiàn))系列---演示篇(三) Heavenkiller(原創(chuàng)) public static void ShowSortedList_Polynomial() //...

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

                            Heavenkiller(原創(chuàng))

 

         public static void ShowSortedList_Polynomial()

         {

              //100+10*x+x^2  + 1+10*x+100x^2

              SortedList tmpListA=new SortedList();

              SortedList tmpListB=new SortedList();

              SortedList tmpListC=new SortedList();//used to store the result

              SortedList tmpKeyList=new SortedList();//used to store all keys of two polynomials

 

 

              //init polynomial A and show it

              tmpListA.Add(0,100);

              tmpListA.Add(1,10);

              tmpListA.Add(2,1);

              ShowSortedList_ShowPolynomial("tmpListA",tmpListA.GetEnumerator());

 

              //init polynomial B and show it

              tmpListB.Add(0,1);

              tmpListB.Add(1,10);

              tmpListB.Add(2,100);

              ShowSortedList_ShowPolynomial("tmpListB",tmpListB.GetEnumerator());

 

              //init the key list which contains all keys of A and B but everyone once

              IDictionaryEnumerator tmpIDic=tmpListA.GetEnumerator();

              while(tmpIDic.MoveNext()!=false)

              {

                   if(!tmpKeyList.ContainsKey(tmpIDic.Key))

                   {

                       tmpKeyList.Add(tmpIDic.Key,null);

                   }

              }

 

              tmpIDic=tmpListB.GetEnumerator();

              while(tmpIDic.MoveNext()!=false)

              {

                   if(!tmpKeyList.ContainsKey(tmpIDic.Key))

                   {

                       tmpKeyList.Add(tmpIDic.Key,null);

                   }

              }

 

              //Add A and B and show the result

              tmpIDic=tmpKeyList.GetEnumerator();

              while(tmpIDic.MoveNext()!=false)

              {

                   object objA=null,objB=null,objC=null;

                   objC=tmpIDic.Key;

                   if(tmpListA.ContainsKey(objC))

                       objA=tmpListA[objC];

                   if(tmpListA.ContainsKey(objC))

                       objB=tmpListB[objC];

                   //objC=objA+objB;

                   //tmpKeyList[objC]=(int)objA+(int)objC;

                   tmpListC.Add(objC,(int)objA+(int)objB);

 

              }

              ShowSortedList_ShowPolynomial("the addition result of A and B",tmpListC.GetEnumerator());

 

        

             

         }

         public static void ShowSortedList_ShowPolynomial(string tip,IDictionaryEnumerator iDic)

         {

              string strExpress=null;

              iDic.Reset();

              while(iDic.MoveNext()!=false)

              {

                   strExpress+=iDic.Value.ToString()+"*X^"+iDic.Key.ToString()+"+";

              }

              Console.WriteLine(tip+":"+strExpress);

 

         }

 

}




主站蜘蛛池模板: 亚洲狠狠97婷婷综合久久久久 | 中文字幕第九页 | 色狠狠色综合吹潮 | 青青青国产手机在线播放 | 日韩不卡手机视频在线观看 | 伊人久久大香线蕉综合热线 | 日韩黄色一级毛片 | 欧美一区色 | 亚洲视频在线免费看 | 婷婷激情五月 | 中日韩视频在线看免费观看 | 天天射天天色天天干 | 四虎在线网址 | 亚洲成肉网 | 日本黄网站高清色大全 | 午夜在线日韩免费精品福利 | 亚洲爱爱网站 | 日韩在线欧美 | 亚洲伊人成综合人影院小说 | 亚洲第九页| 午夜国产福利在线 | 亚洲春色第一页 | 午夜性爽视频男人的天堂在线 | 香港三日本三级人妇三级99 | 青青草自拍 | 四川一级护士一级毛片 | 亚洲一区二区三区免费视频 | 日本激情视频一区二区三区 | 天天综合久久久网 | 速度与激情9免费观看 | 欧美性生活网址 | 亚洲福利国产 | 午夜视频在线观看免费观看在线观看 | 在线a久青草视频在线观看g | 速度与激情9在线观看 | 日韩色在线观看 | 日日摸日日操 | 欧美做a一级视频免费观看 欧美坐爱视频 | 色噜噜狠狠网站 | 日本中文视频 | 色香蕉色香蕉在线视频 |