How to find kth largest element when array is modifiable and k always vary

Правка en2, от 444iq, 2019-09-15 19:41:41

How to find kth largest element each time where k will vary and array is modifiable. That is you can add new elements to the array

for example say array is 10 , 20 , 15.

2nd largest = 15

add 17 to array

array becomes 10 15 17 20

3rd largest = 15

Q <= 10^5.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский 444iq 2019-09-15 19:42:58 31 Tiny change: 'he array\n\nfor ex' -> 'he array\narray can have duplicates. \n\nfor ex'
en2 Английский 444iq 2019-09-15 19:41:41 19
en1 Английский 444iq 2019-09-15 19:38:29 333 Initial revision (published)