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

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

 

         }

 

}




主站蜘蛛池模板: 五月婷婷深爱 | 欧洲成人在线 | 亚洲v日本v欧美v综合v | 日韩一卡2卡3卡新区网站 | 在线观看国产久青草 | 性久久久久 | 伊人久久婷婷丁香六月综合基地 | 欧美一区二区福利视频 | 色yeye在线观视频 | 天天爽夜夜爽一区二区三区 | 亚洲成a人片77788 | 天天久久狠狠色综合 | 日本mv精品中文字幕 | 婷婷六月综合网 | 午夜国产精品久久久久 | 四虎精品福利视频精品 | 亚洲a在线视频 | 日本亚欧乱色视频在线系列 | 午夜a级理论片在线播放 | 天天摸日日添狠狠添婷婷 | 天天激情站| 四虎在线永久 | 日韩精品一区二区三区中文 | 欧美在线一 | 亚洲精品第一页中文字幕 | 我想看一级黄色毛片 | 日韩黄 | 欧美在线视频观看 | 亚洲精品中文字幕乱码三区一二 | 天天爱天天做天天干 | 香蕉久草视频 | 伊人一区二区三区 | 天天躁日日躁狠狠躁欧美日韩 | 欧美在线免费 | 欧美性战| 永久国产 | 日本aⅴ在线 | 综合色在线观看 | 天天碰夜夜操 | 亚洲视频在线免费看 | 伊人网址 |