algorithm
1. algorithm是STL中的一种,主要是用来分类和排序的。be used on ranges of elements
2. 谓词:用来描述或判定客体性质、特征或者客体之间关系的词项。
例如:"猫是动物"一句中的"是动物"就是一个谓词,而"猫"是客体。"3 大于 2"中"大于"是一个谓词。
Functions in <algorithm>
Non-modifying sequence operations:
1. all_of :Testcondition on all elements in range (functiontemplate )
Test ifany element in range fulfills condition (function template )
Test ifno elements fulfill condition (function template )
Applyfunction to range (function template )
find:利用等于操作符,对范围内的元素与输入值进行比较,匹配时,返回该元素的一个指针
Findvalue in range (function template )
Findelement in range (function template )
Findelement in range (negative condition) (function template )
Find lastsubsequence in range (function template )
Findelement from set in range (function template )
Findequal adjacent elements in range (function template )
Countappearances of value in range (function template )
Returnnumber of elements in range satisfying condition (function template )
Returnfirst position where two ranges differ (function template )
Testwhether the elements in two ranges are equal (function template )
Testwhether range is permutation of another (function template )
Searchrange for subsequence (function template )
Searchrange for elements (function template )
Modifying sequence operations:
Copyrange of elements (function template )
Copyelements (function template )
Copycertain elements of range (function template )
Copyrange of elements backward (function template )
Move rangeof elements (function template )
Moverange of elements backward (function template )
Exchangevalues of two objects (function template )
Exchangevalues of two ranges (function template )
Exchangevalues of objects pointed by two iterators (function template )
Transformrange (function template )
Replacevalue in range (function template )
Replacevalues in range (function template )
Copyrange replacing value (function template )
Copyrange replacing value (function template )
Fillrange with value (function template )
Fillsequence with value (function template )
Generatevalues for range with function (function template )
Generatevalues for sequence with function (function template )
Removevalue from range (function template )
Removeelements from range (function template )
Copyrange removing value (function template )
Copyrange removing values (function template )
Removeconsecutive duplicates in range (function template )
Copyrange removing duplicates (function template )
Reverserange (function template )
Copyrange reversed (function template )
Rotateleft the elements in range (function template )
Copyrange rotated left (function template )
Randomlyrearrange elements in range (function template )
Randomlyrearrange elements in range using generator (function template )
Partitions:
Testwhether range is partitioned (function template )
Partitionrange in two (function template )
Partitionrange in two - stable ordering (function template )
Partitionrange into two (function template )
Getpartition point (function template )
Sorting:
Sortelements in range (function template )
Sortelements preserving order of equivalents (function template )
Partiallysort elements in range (function template )
Copy andpartially sort range (function template )
Checkwhether range is sorted (function template )
Findfirst unsorted element in range (function template )
Sortelement in range (function template )
Binary search (operating on partitioned/sorted ranges):
Returniterator to lower bound (function template )
Returniterator to upper bound (function template )
Getsubrange of equal elements (function template )
Test ifvalue exists in sorted sequence (function template )
Merge (operating on sorted ranges):
Mergesorted ranges (function template )
Mergeconsecutive sorted ranges (function template )
Testwhether sorted range includes another sorted range (function template )
Union oftwo sorted ranges (function template )
Intersectionof two sorted ranges (function template )
Differenceof two sorted ranges (function template )
Symmetricdifference of two sorted ranges (function template )
Heap:
Pushelement into heap range (function template )
Popelement from heap range (function template )
Make heapfrom range (function template )
Sortelements of heap (function template )
Test ifrange is heap (function template )
Findfirst element not in heap order (function template )
Min/max:
Returnthe smallest (function template )
Returnthe largest (function template )
Returnsmallest and largest elements (function template )
Returnsmallest element in range (function template )
Returnlargest element in range (function template )
Returnsmallest and largest elements in range (function template )
Other:
Lexicographicalless-than comparison (function template )
Transformrange to next permutation (function template )
Transformrange to previous permutation (function template )