文件名称:CPP-Findkth
介绍说明--下载内容均来自于网络,请自行研究使用
如果某个整数x(x> 1)存在一个数组中,则2*x+1和3*x+1也必定在这个数组中,已知1为该数组中的元素,现给定一个整数k(k> 1),要求求出该数组中的第k大的数。例如a[3] {1,2,3},当k 1,则返回3;k 2,则返回2;k 3,则返回1;k> 4或k<1,输出错误。-If an integer x (x> 1) exists in an array, then 2* x+ 1 and 3* x+ 1 must also be in this array, known as 1 for the array of elements, given an integer K (k> 1), it is required to find the number of the kth largest in the array.For example,a[3] {1,2,3},if k 1 ,then the result is 3 if k 2,then the result is 2 if k 3,then the result is 1 if k> 4 or k<1,then the output is wrong.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
C++ Findkth.docx