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

明輝手游網(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人v欧美综合天堂麻豆 | 天天色天天摸 | 日本激情在线看免费观看视频 | 在线视频一区二区日韩国产 | 奇米狠狠操 | 青青青国产色视频在线观看 | 又大又硬又爽又粗又快的视频免费 | 青娱乐在线免费观看 | 新版天堂中文资源官网 | 午夜在线免费观看视频 | 一级毛片a女人刺激视频免费 | 伊人久久五月 | 日韩第七页| 青青草原网站在线观看 | 天天色影 | 三级黄色片免费观看 | 日韩在线观看视频免费 | 中文字幕不卡免费高清视频 | 偷窥自拍首页 | 日韩免费在线视频观看 | 日日躁夜夜躁狠狠天天 | 天美传媒一区 | 天天插天天透 | 亚洲精品视频区 | 青青草原在线视频免费观看 | 亚洲视频一区二区在线观看 | 日本小视频在线 | 天天看a | 日韩无砖专区 | 婷婷深爱| 五月天丁香婷婷网 |