kthlargest and kthelemnt programs