快速排序扩展---topK

#include "iostream"
#include "string.h"
int partition(int a[],int left,int right)
{
	int i = left;
	int j = right;
	int temp = a[i];
	while (i= temp)
			j--;
		if (ik)
		topK(a, dp+1,right,k);
	}
}

int main()
{
  int a[8]={3,4,1,6,4,8,5,1};
  int b[8];
  memcpy(b,a,sizeof(b));
  //快排
  quickSort(a,0,7);
  for(int i=0;i<8;i++)
    std::cout<

 

你可能感兴趣的:(快速排序扩展---topK)