1,535 views
0 votes
0 votes
In a binary min heap with n elements, the 7th smallest element can be found in _____ ?

Answer given is O(logn)

and solution:-

Delete the 1st smallest element O(logn)

Delete the 2nd smallest element O(logn)

....

Delete the 7th smallest element O(logn).

So in total O(logn).

In this solution the data arrangement of the heap will be changed after performing these operation.

any better solution than this???

Please log in or register to answer this question.

Related questions

8 votes
8 votes
3 answers
1
Kapil asked Sep 4, 2016
3,981 views
In a min-heap with n elements1). The 7th smallest element can be found in time, if duplicates are allowed ?2). The 7th distinct smallest element can be found in time, I...
1 votes
1 votes
1 answer
2
11 votes
11 votes
5 answers
3
Vikrant Singh asked Dec 28, 2014
3,710 views
What is the complexity of finding $50^{th}$ smallest element in an already constructed binary min-heap?$\Theta(1)$$\Theta (\log n)$$\Theta (n)$$\Theta (n \log n)$
1 votes
1 votes
1 answer
4
gmrishikumar asked Dec 1, 2018
2,309 views
What is the time complexity to find the Kth largest element in a Min-Heap? Or equivalently, What is the time complexity to find Kth smallest element in Max-Heap?