topK

Returns the top k elements as a list of Pair(index, score).