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

            洗塵齋

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

            常用鏈接

            統計

            最新評論

            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)查找相同元素的首次出現或能使pr(elem,nextElem)為true的元素的位置 ,函數查找成功返回位置,失敗返回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);
            在區間[first,last)中查找元素val,如果找到返回true,否則返回false,第二種形式pr用于設定查找準則
            count size_t count(InIt first,InIt last,const T& val); 返回區間[first,last)上val出現的次數
            count_if size_t count_if(InIt first,InIt last,Pred pr); 返回區間[first,last)上滿足條件pr(elem)的元素個數
            equal bool equal(InIt1 first,InIt1 last,InIt2 x);
            bool equal(InIt1 first,InIt1 last,InIt2 x,Pred pr);
            判斷[first,last)與x開始的區間的元素是否相等,pr用于指定判斷函數
            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第一次出現的位置和最后出現的位置的下一位組成的對,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首次出現的位置,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最后一次出現的下一個位置,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)之間查找能使函數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)最后出現的位置,如果找到返回位置,失敗返回last1,第二個函數的pr函數用于比較兩個容器的元素,在兩個容器的元素相等時返回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)之間查找第一次出現[first2,last2)中元素的位置,找到返回位置,失敗返回last1,第二個函數pr用于比較兩個容器的元素是否相等
            for_each Fun for_each(InIt first,InIt last, Fun f); 對[first,last)上的所有元素執行函數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)中是否包含區間已排序區間[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開始的序列第一個不匹配的位置的兩個迭代器組成的對
            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)用于指定比較規則
            max_element FwdIt max_element(FwdIt first,FwdIt last);
            FwdIt max_element(FwdIt first,FwdIt last, Pred pr);
            返回區間[first,last)上最大值的位置,pr(elem1,elem2)用于指定比較規則
            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)用于指定比較規則
            min_element FwdIt min_element(FwdIt first,FwdIt last);
            FwdIt min_element(FwdIt first,FwdIt last, Pred pr);
            返回區間[first,last)上的最小值的位置,pr(elem1,elem2)用于指定比較規則
            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)中查找子區間[first2,last2),如果找到返回在第一個區間中的位置,失敗返回last1,第二種形式pr函數用于設定比較函數
            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)中查找連續n個val,如果找到返回在區間中的位置,失敗返回last,第二種形式pr用于設定比較函數

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

            精品久久人人爽天天玩人人妻| 国产一久久香蕉国产线看观看 | 久久国产乱子伦精品免费午夜| 亚洲国产精品久久66| 久久精品成人免费观看97| 久久亚洲国产精品五月天婷| 久久国产劲爆AV内射—百度| 国产美女久久精品香蕉69| 国产日韩久久免费影院| 97精品伊人久久大香线蕉| 精品无码久久久久久午夜| 无码8090精品久久一区| 久久国产精品成人免费| 亚洲国产成人精品女人久久久| 久久精品国产网红主播| 亚洲AⅤ优女AV综合久久久| 国产成人久久AV免费| 久久久久久亚洲精品影院| 91精品国产91久久| 久久亚洲欧美国产精品| 亚洲国产成人久久综合一区77| 99久久精品国内| 久久精品国产2020| 女人高潮久久久叫人喷水| 久久线看观看精品香蕉国产| 国产A级毛片久久久精品毛片| 久久久久18| 四虎国产永久免费久久| 国产精品久久久久久一区二区三区| 手机看片久久高清国产日韩| 伊人久久综合热线大杳蕉下载| 日产精品99久久久久久| 久久99久国产麻精品66| 久久无码一区二区三区少妇 | 久久天堂AV综合合色蜜桃网| 久久91精品国产91| 人妻无码久久精品| 三级片免费观看久久| 久久综合丁香激情久久| 天天久久狠狠色综合| 久久最近最新中文字幕大全|