Exercises
-
16.4 State whether each of the following is true or false. If false, explain why.
Because Standard Library algorithms process containers directly, one algorithm can often be used with many different containers.
Use the
for_each
algorithm to apply a general function to every element in a range;for_each
does not modify the sequence.By default, the
sort
algorithm arranges the elements in a range in ascending order.Use the
merge
algorithm to form a new sequence by placing the second sequence after the first.Use the
set_intersection
algorithm to find the elements from a first set of sorted values that are not in a second set of sorted values (both sets of values must be in ascending order).Algorithms
lower_bound, upper_bound
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.