Example: confidence

Table of Contents - Reference

Of ContentsC++ Standard Template the C++ Standard Template ++ ++ Algorithms ..10accumulate ..12adjacent_difference ..12adjacent_find ..13binary_search ..14copy ..15copy_backward ..16copy_n ..17count_if ..18equal ..19equal_range ..20fill ..21fill_n ..22find ..23find_end ..24find_first_of ..25find_if ..26for_each ..27generate ..27generate_n ..28includes ..28inner_product ..29inplace_merge ..29is_heap ..30is_sorted ..30iter_swap ..31lexicographical_compare ..31lexicographical_compare_3way ..32lower_bound ..33make_heap ..34max ..34max_element ..35merge ..36min ..36min_element ..37mismatch ..37next_permutation ..38nth_element ..38partial_sort ..39partial_sort_copy ..39partial_sum ..40partition ..40 Page ..41prev_permutation ..41push_heap ..42random_sample ..42random_sample_n ..43random_shuffle ..43remove ..44remove_copy ..44remove_copy_if ..45remove_if ..45replace ..46replace_copy ..46replace_copy_if ..46replace_if ..47reverse.

inner_product compute the inner product of two ranges of elements inplace_merge merge two ordered ranges in-place is_heap returns true if a given range is a heap is_sorted returns true if a range is sorted in ascending order iter_swap swaps the elements pointed to by two iterators

Tags:

  Product, Swaps

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Table of Contents - Reference

1 Of ContentsC++ Standard Template the C++ Standard Template ++ ++ Algorithms ..10accumulate ..12adjacent_difference ..12adjacent_find ..13binary_search ..14copy ..15copy_backward ..16copy_n ..17count_if ..18equal ..19equal_range ..20fill ..21fill_n ..22find ..23find_end ..24find_first_of ..25find_if ..26for_each ..27generate ..27generate_n ..28includes ..28inner_product ..29inplace_merge ..29is_heap ..30is_sorted ..30iter_swap ..31lexicographical_compare ..31lexicographical_compare_3way ..32lower_bound ..33make_heap ..34max ..34max_element ..35merge ..36min ..36min_element ..37mismatch ..37next_permutation ..38nth_element ..38partial_sort ..39partial_sort_copy ..39partial_sum ..40partition ..40 Page ..41prev_permutation ..41push_heap ..42random_sample ..42random_sample_n ..43random_shuffle ..43remove ..44remove_copy ..44remove_copy_if ..45remove_if ..45replace ..46replace_copy ..46replace_copy_if ..46replace_if ..47reverse.

2 47reverse_copy ..47rotate ..48rotate_copy ..48search ..49search_n ..49set_difference ..50set_intersection ..50set_symmetric_difference ..51set_union ..51sort ..52sort_heap ..54stable_partition ..54stable_sort ..55swap ..55swap_ranges ..56transform ..56unique ..57unique_copy ..57upper_bound ..58C++ Vectors ..59 Vector constructors ..60 Vector operators ..61assign ..62at ..63back ..64begin ..65capacity ..66clear ..67empty ..67end ..68erase ..69front ..71 Page ..72max_size ..73pop_back ..74push_back ..74rbegin ..75rend ..75reserve ..75resize ..76size ..76swap ..77C++ Double-ended Queues ..78 Container constructors ..79 Container operators ..80 Container [] operator ..81 Container constructors & destructors ..81assign ..82at ..83back ..84begin ..85clear ..86empty ..86end ..87erase ..88front ..89insert ..90max_size ..91pop_back ..91pop_front ..91push_back ..92push_front ..92rbegin ..93rend ..93resize ..93size ..94swap ..94C++ Lists.

3 95 List constructors ..96 List operators ..97 Container constructors & destructors ..98assign ..99back ..100begin ..101clear ..101empty ..102end ..102erase ..103front ..104 Page ..105max_size ..106merge ..106pop_back ..106pop_front ..107push_back ..107push_front ..108rbegin ..108remove ..109remove_if ..109rend ..110resize ..110reverse ..110size ..111sort ..111splice ..111swap ..112unique ..112C++ Priority Queues ..113 Priority queue constructors ..113empty ..114pop ..114push ..115size ..115top ..116C++ Queues ..117 Queue constructor ..118back ..119empty ..119front ..120pop ..120push ..120size ..121C++ Stacks ..122 Stack constructors ..122empty ..123pop ..123push ..124size ..124top ..125C++ Sets ..126 Set constructors & destructors ..127 Set operators ..128begin ..129clear ..129count ..130empty ..130 Page ..131equal_range ..131erase ..132find ..132insert ..132key_comp ..133lower_bound ..133max_size ..133rbegin ..134rend ..134size.

4 135swap ..135upper_bound ..136value_comp ..136C++ Multisets ..137 Container constructors & destructors ..138 Container operators ..139begin ..140clear ..140count ..141empty ..141end ..142equal_range ..142erase ..143find ..143insert ..143key_comp ..144lower_bound ..144max_size ..144rbegin ..145rend ..145swap ..146upper_bound ..146value_comp ..146C++ Maps ..147 Map Constructors & Destructors ..148 Map operators ..149begin ..150clear ..151count ..151empty ..152end ..153equal_range ..153erase ..154find ..155insert ..156key_comp ..157 Page ..157max_size ..157rbegin ..158rend ..158size ..158swap ..159upper_bound ..159value_comp ..159C++ Multimaps ..160 Multimap constructors & destructors ..161 Multimap operators ..162begin ..163clear ..163count ..164empty ..164end ..165find ..165equal_range ..166erase ..166insert ..167key_comp ..168lower_bound ..168max_size ..168rbegin ..169rend ..169size ..170swap ..170upper_bound ..171value_comp.

5 171C++ Bitsets ..172 Bitset Operators ..173 Bitset Constructors ..174any ..175count ..175flip ..175none ..176reset ..176set ..176size ..176test ..177to_string ..177to_ulong ..177 Page ++ Standard Template LibraryPage the C++ Standard Template LibraryThe C++ STL (Standard Template Library) is a generic collection of class templates and algorithms that allow programmers to easily implement standard data structures like queues, lists, and C++ STL provides programmers with the following constructs, grouped into three categories: Sequences C++ Vectors C++ Lists C++ Double-Ended Queues Container Adapters C++ Stacks C++ Queues C++ Priority Queues Associative Containers C++ Bitsets C++ Maps C++ Multimaps C++ Sets C++ Multisets The idea behind the C++ STL is that the hard part of using complex data structures has already been completed. If a programmer would like to use a stack of integers, all that she has to do is use this code:stack<int> myStack;With minimal effort, she can now push() and pop() integers onto this stack.

6 Through the magic of C++ Templates, she could specify any data type, not just integers. The STL Stack class will provide generic functionality of a stack, regardless of the data in the addition, the STL also provides a bunch of useful algorithms -- like searching, sorting, and general-purpose iterating algorithms -- that can be used on a variety of data ++ IteratorsIterators are used to access members of the container classes, and can be used in a similar manner to pointers. For example, one might use an iterator to step through the elements of a vector. There are several different types of iterators:IteratorDescriptioninput_itera torRead values with forward movement. These can be incremented, compared, and values with forward movement. These can be incremented and or write values with forward movement. These combine the functionality of input and output iterators with the ability to store the iterators and write values with forward and backward movement.

7 These are like the forward iterators, but you can increment and decrement and write values with random access. These are the most powerful iterators, combining the functionality of bidirectional iterators with the ability to do pointer arithmetic and pointer a random iterator or a bidirectional iterator that moves in reverse of the container classes is associated with a type of iterator, and each of the STL algorithms uses a certain type of iterator. For example, vectors are associated with random-access iterators, which means that they can use algorithms that require random access. Since random-access iterators encompass all of the characteristics of the other iterators, vectors can use algorithms designed for other iterators as following code creates and uses an iterator with a vector: vector<int> the_vector; vector<int>::iterator the_iterator; for( int i=0; i < 10; i++ ) (i); int total = 0; the_iterator = (); while( the_iterator !)

8 = () ) { total += *the_iterator; the_iterator++; } cout << "Total=" << total << endl;Notice that you can access the elements of the container by dereferencing the iterator. Page ++ Algorithms accumulatesum up a range of elementsadjacent_differencecompute the differences between adjacent elements in a rangeadjacent_findfinds two items that are adjacent to eachotherbinary_searchdetermine if an element exists in a certain rangecopycopy some range of elements to a new locationcopy_backwardcopy a range of elements in backwards ordercopy_ncopy N elementscountreturn 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

9 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 heapis_sortedreturns true if a range is sorted in ascending orderiter_swapswaps the elements pointed to by two iteratorslexicographical_comparereturns true if one range is lexicographically less than anotherlexicographical_compare_3waydeter mines if one range is lexicographically less than or greater 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 groupsPage the largest element from a heapprev_permutationgenerates the next smaller lexicographic permutation of a range of elementspush_heapadd an element to a heaprandom_samplerandomly copy elements from one range to anotherrandom_sample_nsample N random elements from a rangerandom_shufflerandomly re-order elements in some rangeremoveremove elements equal to

10 Certain valueremove_copycopy a range of elements omitting those that match a certian 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


Related search queries