方法一:是利用的是“得到数组中第k大的数字”算法。即快排的partition方法或者大根堆方法。 快排的partition方法 大根堆方法 class Solution {Random random=new Random();public int majorityElement(i……