List is a ring-type dual LIST, so , - even if it is, it will not have problems.
And vector / heap is a linear space, / - is a problem; so be sure to take into account
HEAP Pile Features: The first is the maximum element, DE / ADD is a complexity of elemental time to log (n)
Make_heap converts the data into a heap, adjusts the entire stack), sort_heap (sequencefully stored in the stack of order, this is not a pile; otherwise, it has always been existed with the structure of the stack), push_heap (for the last element, adjust the stack Part), POP_HEAP (moving the maximum element to finally adjusting the relevant parts of the heap)
Mutating Algorithms & Nonmutating Algorithms
Materialation Algorithm: Copy, Swap, Replace / Replace_copy, Fill, Remove, Permutation, Partition, Random_shuffling, Sort
Non-varying algorithm: Find, Search, Count, for_each, Equal / mismatch, max / min
. STL is generally this form!
If the two parameters of the generic function of STL, Iterator, called First, Last
STL habits are expressed in a round closed interval, namely: [first, last)
Numeric.
Accumulate, Inner_Product, AdjaCent_Difference (two adjacent elements), Partial_Sum (before i cumulative operation)
All of these computing parts can be replaced by imitation functions. E.G., Minus
Algorithm.
If the parameter is (first1, last1, first2), ie: interval 1, interval 2; then the default end condition is: interval 1 -> until last1; then if the number of interval 2 is less than the number of interval 1, then The result is unknown. If it is a list type, the result is unknown, the program does not crash; if it is a vector type, the program may crash
Equal (Elements of Enumeration Interval, Compared with Interval 2)
Fill (set all the elements of the interval to x), Fill_N (set the previous N element set of a certain section to x)
iter_swap (exchanged the element value referred to as the cursor), swap (exchange value)
Min / max, mismatch (find a location of the first element value); if the interval 2 is 1 short, the result is not expected)
Lexicographical_compare (like a comparison string, not only a shorter number of elements)
COPY, if the input interval and the output interval have overlap, the results may be errors, or it may be correct. (If the internal use of Memmov is correct)
Collection operations can only be targeted for SET / MULTITISET, can not be targeted for haveh_set, haveh_multiset
Set_INTERSECTION (Intersection), Set_union, Set_Difference (Difference), set_symmetric_difference (ie (S1-S2) U (S2-S1))
The advanced algorithm is for the Vector storage structure, many of them are for the orderless vector
** Find
Lower_bounder / Upper_bounder, fold half look up for a certain value, or is best suited to insert a certain value
Equal_Range, folding half lookup, return Lower_Bounder and Upper_bounder, a pair of binary_search, folding half lookup (call Lower_Bounder)
** Permutations
Random_shuffle, ranked, arranged is a uniform distribution, the algorithm taken is "the art of programing" above
Next_permutation / prev_permutation, the previous / latter arrangement; (default ascending)
The algorithm is: from the previous scan, find the adjacent element (AB) of the order, then find the element X greater than element A, exchange the A and X swap position, and finally B will Reverse (including B)
** Sort
SORT, using Introsort (number of hours, insert sorting; otherwise, rapid sorting, if fast sorting is too deep, HEAP processing is used), O (N * log (n))
Stable_sort, when a small number (smaller than the threshold), insert sorting; otherwise, use a merge order (MERGE, you need to buffer intermediate results, so space is not associated)
Inplace_merge, combine two sequences connected together
Partial_sort / partial_sort_copy, take the HEAP mode, the second half of the POP is behind, in the first half head_sort
Nth_Element, less guaranteed than Partial_Sort, I don't know where to use?
** partition
Stable_partition, stable partition
Partition, partition (unstable)