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

明輝手游網(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);

 

         }

 

}




主站蜘蛛池模板: 欧美性乱 | 青青草视频在线观看 | 一区小说二区另类小说三区图 | 天天影视色香欲综合免费 | 亚洲欧美综合在线观看 | 日日爱网 | 青娱乐国产| 中文字幕精品一区影音先锋 | 日韩精品导航 | 青青在线视频免费看观看 | 亚洲成a人片77788 | 天天干夜夜夜操 | 日韩无砖专区 | 性刺激欧美三级在线观看 | 又大又硬又粗又爽免费 | 日韩在线激情 | 婷婷丁香在线 | 欧美在线一二三 | 亚洲精品亚洲人成在线播放 | 人人爽人人香蕉 | 依人在线观看 | 五月丁香啪啪 | 青草久久网| 欧美香蕉人人人人人人爱 | 一级黄色a级片 | 日韩在线黄色 | 情侣国产在线 | 三级免费黄色片 | 在线免费h视频 | 亚洲精品在线免费观看视频 | 日本三级网络 | 伊人免费在线观看 | 青青在线视频免费看观看 | 性喷潮久久久久久久久 | 色妞网欧美 | 亚洲免费a| 四虎免费影院在线播放 | 天天干天天综合 | 日韩a在线看免费观看视频 日韩a在线观看免费观看 | 色婷婷丁香 | 日韩黄色在线播放 |