c_-_13_-_stl_algorithms

# c_-_13_-_stl_algorithms - Chapter 20 STL Algorithms STL...

This preview shows pages 1–13. Sign up to view the full content.

Chapter 20 STL Algorithms

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
STL Algorithms Algorithms : Algorithms are function templates that manipulate data such as sorting, searching, and comparing elements in containers through iterators .
Iterators and Pointers Iterators are a generalization of pointers . Pointers themselves are iterators. So the array pointers can be treated as iterators. Iterators are often used with containers, but some iterators such as istream_iterator and ostream_iterator are not associated with containers at all.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Types of Algorithms The STL provides approximately 80 algorithms. The algorithms can be classified into four groups: Nonmodifying Algorithms Modifying Algorithms Numeric Algorithms Heap Algorithms
What is MSDN? MSDN is an acronym for the Microsoft Developer Network . MSDN provides up-to-date and comprehensive development resources so that developers can successfully develop solutions for Microsoft platforms and technologies. MSDN Library is a library of official technical documentation content intended for developers developing for Microsoft Windows.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
copy template < typename InputIterator , typename OutputIterator > OutputIterator copy( InputIterato r beg, InputIterator end, OutputIterator targetPostition)
copy

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
fill and fill_n template < typename ForwardIterator , typename T > void fill( ForwardIterator beg, ForwardIterator end, const T &value) template < typename ForwardIterator , typename size , typename T > void fill_n( ForwardIterator beg, size n, const T &value)
generate and generate_n template <typename ForwardIterator, typename function> void generate(ForwardIterator beg, ForwardIterator end, function gen) template < typename ForwardIterator, typename size, typename function> void generate_n(ForwardIterator beg, size n, function gen)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
remove, remove_if template <typename ForwardIterator, typename T> ForwardIterator remove(ForwardIterator beg, ForwardIterator end, template <typename ForwardIterator, typename boolFunction> ForwardIterator remove_if(ForwardIterator beg, ForwardIterator end, boolFunction f)
remove, remove_if

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
remove, remove_if cout << "\nAfter the remove function, values: "; copy(values, remove(values, values + 10, 3), output); cout << "\nAfter the remove_if function, intList: "; copy(intList.begin(), remove_if(intList.begin(), intList.end(), greaterThan3), output);
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/12/2011 for the course ECON 101 taught by Professor Professor during the Spring '10 term at Cisco Junior College.

### Page1 / 37

c_-_13_-_stl_algorithms - Chapter 20 STL Algorithms STL...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online