CHAPTER 6

image

Sorting, Merging, Searching, and Partitioning

This chapter describes algorithms that are loosely related to sorting and merging ranges. Two groups of these specifically provide sorting and merging capabilities. Another group provides mechanisms for partitioning a range relative to a given element value. Two further groups provide ways of finding one or more elements in a range. In this chapter you’ll learn about:

  • How to sort a range defined by random access iterators into ascending or descending sequence.
  • How to prevent equal elements from being resequenced in a sort operation.
  • How to merge ordered ranges.
  • How you can search an unordered ...

Get Using the C++ Standard Template Libraries now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.