Find sum of K largest elements in an array
While the idea is perfectly sound, there are reasons to prefer a min heap approach:


The min heap guarantees an \$O(n \log k)\$ time complexity. Your method
may degenerate to \$O(nk)\$ for nearly sorted data.
The min heap works with streaming data. Your method requires the
entire data set to be present.
The min heap preserves the original order. Your method rearranges
data.


You may also gain some performance with tail recursion elimination:


First, convert the getKthLargestIndex into really tail recursive form:

    if (k == rank) {
        return p;
    if ( k &lt; rank) {
        h = p - 1;
    }
    else {
        k -= rank;
        l = p + 1;
    }
    return getKthLargestIndex(a, k, l , h);

Now replace the recursion with a loop:

    private int getKthLargestIndex(int[] a, int k, int l, int h) {
        while (1) {
            int p = partition(a, l, h);
            int rank = p - l +1;

            if (rank == k) {
                return p;
            }

            if ( k &lt; rank) {
                h = p - 1;
            }
            else {
                k -= rank;
                l = p + 1;
            }
        }
    }