...

/

Solved Problem - Kth Largest element

Solved Problem - Kth Largest element

In this lesson, we'll discuss a solved heap problem.

Problem statement

Given an array, A[]A[], consisting of NN integers; for a given KK, find the KthK^{th} largest element in the array.

Input format

The first line consists of two integers NN and KK (1KN106)(1 \leq K \leq N \leq 10^6).

The second line consists of ...

Access this course and 1400+ top-rated courses and projects.