标准库算法学习

来源:互联网 发布:equal的用法Java 编辑:程序博客网 时间:2024/06/05 04:05
accumulate

sum up a range of elements

计算一个范围中的值之和。

adjacent_difference

compute the differences between adjacent elements in a range

计算相邻的元素之间的差分。

adjacent_find

finds two identical (or some other relationship) items adjacent to each other

找到有某种关系的相邻元素。

binary_search

determine if an element exists in a certain range

在一个范围中查找某元素

copy

copy some range of elements to a new location

把一个范围中的元素复制到一个新的位置。

copy_backwardcopy a range of elements in backwards ordercountreturn the number of elements matching a given valuecount_ifreturn the number of elements for which a predicate is trueequaldetermine if two sets of elements are the sameequal_rangesearch for a range of elements that are all equal to a certain elementfillassign a range of elements a certain valuefill_nassign a value to some number of elementsfindfind a value in a given rangefind_endfind the last sequence of elements in a certain rangefind_first_ofsearch for any one of a set of elementsfind_iffind the first element for which a certain predicate is truefor_eachapply a function to a range of elementsgeneratesaves the result of a function in a rangegenerate_nsaves the result of N applications of a functionincludesreturns true if one set is a subset of anotherinner_productcompute the inner product of two ranges of elementsinplace_mergemerge two ordered ranges in-placeis_heapreturns true if a given range is a heapiter_swapswaps the elements pointed to by two iteratorslexicographical_comparereturns true if one range is lexicographically less than anotherlower_boundsearch for the first place that a value can be inserted while preserving ordermake_heapcreates a heap out of a range of elementsmaxreturns the larger of two elementsmax_elementreturns the largest element in a rangemergemerge two sorted rangesminreturns the smaller of two elementsmin_elementreturns the smallest element in a rangemismatchfinds the first position where two ranges differnext_permutationgenerates the next greater lexicographic permutation of a range of elementsnth_elementput one element in its sorted location and make sure that no elements to its left are greater than any elements to its rightpartial_sortsort the first N elements of a rangepartial_sort_copycopy and partially sort a range of elementspartial_sumcompute the partial sum of a range of elementspartitiondivide a range of elements into two groupspop_heapremove the largest element from a heapprev_permutationgenerates the next smaller lexicographic permutation of a range of elementspush_heapadd an element to a heaprandom_shufflerandomly re-order elements in some rangeremoveremove elements equal to certain valueremove_copycopy a range of elements omitting those that match a certain valueremove_copy_ifcreate a copy of a range of elements, omitting any for which a predicate is trueremove_ifremove all elements for which a predicate is truereplacereplace every occurrence of some value in a range with another valuereplace_copycopy a range, replacing certain elements with new onesreplace_copy_ifcopy a range of elements, replacing those for which a predicate is truereplace_ifchange the values of elements for which a predicate is truereversereverse elements in some rangereverse_copycreate a copy of a range that is reversedrotatemove the elements in some range to the left by some amountrotate_copycopy and rotate a range of elementssearchsearch for a range of elementssearch_nsearch for N consecutive copies of an element in some rangeset_differencecomputes the difference between two setsset_intersectioncomputes the intersection of two setsset_symmetric_differencecomputes the symmetric difference between two setsset_unioncomputes the union of two setssortsort a range into ascending ordersort_heapturns a heap into a sorted range of elementsstable_partitiondivide elements into two groups while preserving their relative orderstable_sortsort a range of elements while preserving order between equal elementsswapswap the values of two objectsswap_rangesswaps two ranges of elementstransformapplies a function to a range of elementsuniqueremove consecutive duplicate elements in a rangeunique_copycreates a copy of some range of elements that contains no consecutive duplicatesupper_boundsearches for the last place that a value can be inserted while preserving order (first place that is greater than the value)
原创粉丝点击