• <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>

            洗塵齋

            三懸明鏡垂鴻韻,九撩清泉洗塵心

            常用鏈接

            統(tǒng)計(jì)

            最新評論

            STL非修改算法

            由于STL算法都是通過迭代器間接處理容器,下面定義istream_iteratorInIt,ostream_itreatorOutIt,forward_iteratorFwdIt,bidirectional_iterator BidIt,random_iterator RanIt

            非修改算法:

            算法 用法 說明
            adjacent_find FwdIt adjacent_find(FwdIt first,FwdIt last);
            FwdIt adjacent_find(FwdIt first,FwdIt last,Pred pr);
            在[first,last)查找相同元素的首次出現(xiàn)或能使pr(elem,nextElem)為true的元素的位置 ,函數(shù)查找成功返回位置,失敗返回last
            binary_search bool binary_search(FwdIt first,FwdIt last,const T& val);
            bool binary_search(FwdIt first,FwdIt last,const T& val,Pred pr);
            在區(qū)間[first,last)中查找元素val,如果找到返回true,否則返回false,第二種形式pr用于設(shè)定查找準(zhǔn)則
            count size_t count(InIt first,InIt last,const T& val); 返回區(qū)間[first,last)上val出現(xiàn)的次數(shù)
            count_if size_t count_if(InIt first,InIt last,Pred pr); 返回區(qū)間[first,last)上滿足條件pr(elem)的元素個(gè)數(shù)
            equal bool equal(InIt1 first,InIt1 last,InIt2 x);
            bool equal(InIt1 first,InIt1 last,InIt2 x,Pred pr);
            判斷[first,last)與x開始的區(qū)間的元素是否相等,pr用于指定判斷函數(shù)
            equal pair<FwdIt,FwdIt> equal_range(FwdIt first,FwdIt last,const T& val);
            pair<FwdIt,FwdIt> equal_range(FwdIt first,FwdIt last,const T& val,Pred pr);
            返回元素val第一次出現(xiàn)的位置和最后出現(xiàn)的位置的下一位組成的對,pr指定比較算法
            lower_bound FwdIt lower_bound(FwdIt first,FwdIt last,const T& val);
            FwdIt lower_bound(FwdIt first,FwdIt last,const T& val,Pred pr);
            返回已排序序列[first,last)中val首次出現(xiàn)的位置,pr指定比較算法
            upper_bound FwdIt upper_bound(FwdIt first,FwdIt last,const T& val);
            FwdIt upper_bound(FwdIt first,FwdIt last,const T& val,Pred pr);
            返回已排序序列[first,last)中val最后一次出現(xiàn)的下一個(gè)位置,pr指定比較算法
            find InIt find(InIt first,InIt last,const T& val); 在[first,last)之間查找元素val,如果找到返回位置,找不到返回last
            find_if InIt find_if(InIt first,InIt last, Pred pr); 在[first,last)之間查找能使函數(shù)pr返回true的元素,找到返回位置,否則返回last
            find_end FwdIt1 find_end(FwdIt1 first1,FwdIt1 last1,FwdIt2 first2,FwdIt2 last2);
            FwdIt1 find_end(FwdIt1 first1,FwdIt1 last1,FwdIt2 first2,FwdIt2 last2, Pred pr);
            在[first1,last1)之間查找[first2,last2)最后出現(xiàn)的位置,如果找到返回位置,失敗返回last1,第二個(gè)函數(shù)的pr函數(shù)用于比較兩個(gè)容器的元素,在兩個(gè)容器的元素相等時(shí)返回true
            find_first_of FwdIt1 find_first_of(FwdIt1 first1,FwdIt1 last1,FwdIt2 first2,FwdIt2 last2);
            FwdIt1 find_first_of(FwdIt1 first1,FwdIt1 last1,FwdIt2 first2,FwdIt2 last2, Pred pr);
            在[first1,last1)之間查找第一次出現(xiàn)[first2,last2)中元素的位置,找到返回位置,失敗返回last1,第二個(gè)函數(shù)pr用于比較兩個(gè)容器的元素是否相等
            for_each Fun for_each(InIt first,InIt last, Fun f); 對[first,last)上的所有元素執(zhí)行函數(shù)f(elem),返回值常被忽略
            includes bool includes(InIt1 first1,InIt1 last1,InIt2 first2,InIt2 last2);
            bool includes(InIt1 first1,InIt1 last1,InIt2 first2,InIt2 last2, Pred pr);
            判斷已排序序列[first1,last1)中是否包含區(qū)間已排序區(qū)間[first2,last2),pr指定元素的順序
            mismatch pair<InIt1,InIt2> mismatch(InIt1 first,InIt1 last,InIt2 x);
            pair<InIt1,InIt2> mismatch(InIt1 first,InIt1 last,InIt2 x, Pred pr);
            返回序列[first,last)與x開始的序列第一個(gè)不匹配的位置的兩個(gè)迭代器組成的對
            max const T& max(const T& x,const T& y);
            const T& max(const T& x,const T& y, Pred pr);
            返回x,y之間的較大者,pr(elem1,elem2)用于指定比較規(guī)則
            max_element FwdIt max_element(FwdIt first,FwdIt last);
            FwdIt max_element(FwdIt first,FwdIt last, Pred pr);
            返回區(qū)間[first,last)上最大值的位置,pr(elem1,elem2)用于指定比較規(guī)則
            min const T& min(const T& x,const T& y);
            const T& min(const T& x,const T& y, Pred pr);
            返回x,y之間的較小者,pr(elem1,elem2)用于指定比較規(guī)則
            min_element FwdIt min_element(FwdIt first,FwdIt last);
            FwdIt min_element(FwdIt first,FwdIt last, Pred pr);
            返回區(qū)間[first,last)上的最小值的位置,pr(elem1,elem2)用于指定比較規(guī)則
            search FwdIt1 search(FwdIt1 first1,FwdIt1 last1,FwdIt2 first2,FwdIt2 last2);
            FwdIt1 search(FwdIt1 first1,FwdIt1 last1,FwdIt2 first2,FwdIt2 last2, Pred pr);
            在[first1,last1)中查找子區(qū)間[first2,last2),如果找到返回在第一個(gè)區(qū)間中的位置,失敗返回last1,第二種形式pr函數(shù)用于設(shè)定比較函數(shù)
            search_n FwdIt search_n(FwdIt first,FwdIt last,Dist n,const T& val);
            FwdIt search_n(FwdIt first,FwdIt last,Dist n,const T& val, Pred pr);
            在[first,last)中查找連續(xù)n個(gè)val,如果找到返回在區(qū)間中的位置,失敗返回last,第二種形式pr用于設(shè)定比較函數(shù)

            posted on 2006-04-20 23:24 芥之舟 閱讀(594) 評論(0)  編輯 收藏 引用 所屬分類: STL

            无码精品久久久久久人妻中字| 久久久久亚洲精品中文字幕| 久久精品国产亚洲AV久| 欧洲性大片xxxxx久久久| 亚洲欧美精品一区久久中文字幕 | 欧美色综合久久久久久| 午夜精品久久久久久影视777| 亚洲国产精品综合久久一线| 亚洲va国产va天堂va久久| 好属妞这里只有精品久久| 久久se精品一区精品二区国产| 亚洲国产成人精品女人久久久| 色偷偷88888欧美精品久久久| 91久久精品国产免费直播| 久久九九久精品国产免费直播| 欧美激情精品久久久久| 日本五月天婷久久网站| 狠狠人妻久久久久久综合| 久久精品水蜜桃av综合天堂| 久久激情亚洲精品无码?V| 久久99国产精品久久99| 久久妇女高潮几次MBA| 久久嫩草影院免费看夜色| 久久男人Av资源网站无码软件 | 韩国三级大全久久网站| 亚洲国产精品无码久久久久久曰 | 国内精品免费久久影院| 国产精品99久久99久久久| 久久久WWW成人免费毛片| 国产精品无码久久综合| 国内精品九九久久精品| 亚洲国产香蕉人人爽成AV片久久| 久久精品aⅴ无码中文字字幕重口| 久久人人爽人人爽人人爽| 亚洲精品tv久久久久久久久久| 亚洲午夜久久久精品影院 | 国产精品无码久久久久| 久久99国产精品一区二区| 无码人妻久久一区二区三区免费丨| 久久人人爽人爽人人爽av| 九九久久精品国产|