public int findKthLargest(int[] nums, int k) {


        return partition(nums, 0, nums.length - 1, nums.length - k);
    }
This is quick select algorithm and average time complexity is O(N).
We use k as a pivot.
src/problems/medium/KthLargestElementinanArray.java