This program illustrates the use of the STL partial_sort_copy() algorithm (default version) to sort a range of values from a vector of integers of size 12 into ascending order and copy as many of them as will fit into a range within a second vector of integers. The contents of the initial vector are unchanged by this action. Press Enter to continue ... Here are the initial contents of vector v1: 10 2 6 11 9 3 4 12 8 7 1 5 Press Enter to continue ... Here are the initial contents of vector v2: 100 200 300 400 500 Press Enter to continue ... Now we make the following call: p = partial_sort_copy(v1.begin(), v1.end(), v2.begin(), v2.begin()+3); Press Enter to continue ... After that call, here are the contents of v1: 10 2 6 11 9 3 4 12 8 7 1 5 Press Enter to continue ... And here are the contents of v2: 1 2 3 400 500 Press Enter to continue ... The iterator p returned by the algorithm points to the value 400. Press Enter to continue ... Next we make the following call: p = partial_sort_copy(v1.begin()+2, v1.end()-2, v2.begin(), v2.end()); Press Enter to continue ... After that call, here are the contents of v1: 10 2 6 11 9 3 4 12 8 7 1 5 Press Enter to continue ... And here are the contents of v2: 3 4 6 7 8 Press Enter to continue ... The iterator p returned by the algorithm points to the end of the ouput container. Press Enter to continue ...