LeetCode 1738 找出第 K 大的异或坐标值 快速选择算法
函数 nth_element, STL中实现的快速选择算法,使用时需要包含头文件<algorithm>
void nth_element (Iterator first, Iterator first+nth, Iterator last, Compare comp);
重新排列range [first,last)中的元素,使第n个位置的元素是按排序顺序在该位置的元素。
其他元素没有任何特定的顺序,只是第n个元素之前的元素都不大于该元素,而第n个元素后面的元素均不小于该元素。
手写快排和快选算法
https://blog.csdn.net/qq_40692109/article/details/102696615