Conference:IEEE 43rd International Conference on Distributed Computing Systems (ICDCS)
CCF level:CCF B
Categories:Computer Architecture/Parallel and Distributed Computing/Storage Systems 计算机体系结构/并行与分布计算/存储…
思路:
直接排序是可以的,但是时间复杂度不符合。可以使用优先队列,代码如下:
class Solution {public int findKthLargest(int[] nums, int k) {if (numsnull||nums.length0||k<0||k>nums.length){return Integer.MAX_VAL…