5th Smallest element in a heap is relative to the smallest element, hence in this case should return 1 i.e., the extract min should run 5 times and should return 1. But if u talk about the fifth smallest **distinct** element then implementing it through minheap is surely taking O(nlogn) for the array u mentioned. Instead u can first use one loop to check how many distinct numbers are there in an array which would take O(n) (by using concept similar to that in counting sort) and if there are less numbers, you can conclude that there is no **distinct** 5th smallest element. If more elements then u can continue with extract min.