6 questions. Covers Partial sorting.
Questions 1 to 5 of 6
cpp vector<int> v = {9, 4, 7, 1, 8}; partial_sort(v.begin(), v.begin() + 2, v.end()); cout << v[0] << ' ' << v[1] << '\n';
best
cpp vector<int> src = {3, 9, 1, 7}; vector<int> best(3); partial_sort_copy(src.begin(), src.end(), best.begin(), best.end());
nth_element(v.begin(), v.begin() + 2, v.end())
5 2 8 1 9
v[0]
v[1]
v[2]
std::nth_element
n
partial_sort_copy
greater<int>()
partial_sort
nth_element
std::stable_sort
5 question(s) left on this page.