构建一个k个元素的大根堆,每次和堆顶比较,更小就替换堆顶,再rebuild一下堆### public class Solution { public static void main(String[] args) { System.out.println( new Solution().GetLeastNumbers_Solution(new int[]{4,5,1,6,2,7,3,8}, 4)); } public ArrayList<Integer> GetLeastNumbers_Solution(int [] input, int ...