life is too short for a diary



Posts Tagged: max-heap

Find kth largest element in an array

The other day I stumble upon the question to find the kth largest element in the array. At first glance, I thought the solution was trivial. But later I thought that there are multiple ways to achieve efficient solution...

Continue reading → algorithm ruby heap max-heap projects