First page Back Continue Last page Graphics
// find and print minimum and maximum
// find and print minimum and maximum
- pos = min_element(coll.begin(), coll.end());
- cout << “min: “ << *pos << endl;
- pos = max_element(coll.begin(), coll.end());
- cout << “max: “ << *pos << endl;
// sort all the elements
- sort(coll.begin(), coll.end());
// find the first element with value 3
- pos = find(coll.begin(), coll.end(), 3);
// reverse the order of the found element with value 3 and all the following elements.
- reverse (pos, coll.end());