Max Heap finding kth smallest elements

I am trying to find the kth smallest element in a Max Heap. As I understand I need to sort the Array in increasing order and return when I get the kth smallest element. If I understand correctly a Max Heap is best to use to sort the Array in an increasing order. I am having a problem finding out how to get the kth smallest element, as it would not make sense to wait until the Array is fully sorted, then traverse it with a for loop and get...

Read More »

By: StackOverFlow - Thursday, 8 November

Related Posts