/****************************************************************** find the biggest x number in a sequence* the basic method is the same as the QuickSort** 1. move the smaller one before the pivot* 2. move the bigger one after the pivot* 3. determin
思路: 利用快速排序的划分思想 可以找出前k大数,然后不断划分 直到找到第K大元素 代码: #include <iostream> #include <algorithm> #include <cstdio> using namespace std; int findK(int left, int right, int arr[], int k) { if(left >= right) return arr[left]; int first = left, las