find largest k elements in an array