• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            公子周

                                     --不亂于心,不困于情
            隨筆 - 3, 文章 - 0, 評(píng)論 - 5, 引用 - 0
            數(shù)據(jù)加載中……

            高效的hash_map

            #include <iostream>
            #include <hash_map>
            #include <ctime>
            using namespace std;

            int main()
            {
            hash_map<int,int> hm;
            clock_t startx = clock();
            for(int i = 0; i < 10000000; i++)
            hm.insert(make_pair(i,i));

                     cout<<"插入"<<(double)(clock()-startx)/CLOCKS_PER_SEC<<endl;


            clock_t start = clock();
            clock_t finish;
            double totaltime;

            for(int i = 0; i < 10000000; i++)
            {
            if(hm.find(i)== hm.end())
            cout<<"Error!";
            if(i%1000000 == 0)
            {
            finish = clock();
            totaltime = (double)(finish-start)/CLOCKS_PER_SEC;
            cout<<i<<" "<< totaltime << endl;
            }
            }

            finish = clock();
            totaltime=(double)(finish-start)/CLOCKS_PER_SEC;
            cout<<"\nRuntime is: "<< totaltime << "s" << endl;
            //system("pause");
            return 0;
            }

            Release版本,debug太慢了
            插入3.715
            0 0
            1000000 0.133
            2000000 0.266
            3000000 0.399
            4000000 0.534
            5000000 0.683
            6000000 0.833
            7000000 0.999
            8000000 1.149
            9000000 1.295

            Runtime is: 1.441s

            posted on 2012-07-07 20:45 公子周 閱讀(1384) 評(píng)論(1)  編輯 收藏 引用 所屬分類: 字符串處理

            評(píng)論

            # re: 高效的hash_map  回復(fù)  更多評(píng)論   

            Good....
            2012-07-08 16:32 | eryar

            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久久久久国产精品无码超碰| 中文精品久久久久国产网址| 人人狠狠综合久久亚洲88| 亚洲精品午夜国产VA久久成人| 看全色黄大色大片免费久久久| 久久精品免费一区二区三区| 91精品国产9l久久久久| 乱亲女H秽乱长久久久| 久久久久免费看成人影片| 日本强好片久久久久久AAA| 无码精品久久久天天影视| 久久人爽人人爽人人片AV| 亚洲成色www久久网站夜月| 亚洲AV日韩精品久久久久久久| 777午夜精品久久av蜜臀| 久久久久se色偷偷亚洲精品av| 久久久久久久波多野结衣高潮| 色婷婷综合久久久久中文一区二区| 久久精品国产亚洲av麻豆蜜芽 | 青青青青久久精品国产| 久久福利青草精品资源站免费| 99久久人妻无码精品系列蜜桃| 99久久777色| 久久99精品久久久久久噜噜| 深夜久久AAAAA级毛片免费看| 无码人妻久久一区二区三区蜜桃| 中文字幕热久久久久久久| 久久国产精品99精品国产987| 久久婷婷五月综合色99啪ak| 国产精品久久新婚兰兰| 丰满少妇高潮惨叫久久久| 久久成人国产精品一区二区| 久久婷婷五月综合成人D啪| 97精品国产91久久久久久| 久久综合九色欧美综合狠狠 | 亚洲AV无码久久精品成人| 国产精品久久久久无码av| 亚洲欧美国产日韩综合久久| 久久久噜噜噜久久中文福利| 久久精品国产福利国产琪琪| 狠狠色婷婷久久一区二区|