0 votes 0 votes DS data-structures binary-heap time-complexity + – monty asked Dec 29, 2016 • recategorized Jul 7, 2022 by Lakshman Bhaiya monty 829 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments saurabh rai commented Dec 29, 2016 reply Follow Share @prajwal for 1st min----------------------- 0 comparison for 2nd min------------------------1 comparison . . for 100th min----------------------99 comp so total 99*50=4950 comparison for 100th min .... nd 1 mor thing it is nt a function of n. 1 votes 1 votes Prajwal Bhat commented Dec 29, 2016 reply Follow Share @saurabh rai I got your approach.Thnx 0 votes 0 votes saurabh rai commented Dec 29, 2016 reply Follow Share ^to get more go through https://gateoverflow.in/1110/gate2003-23 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes you can extract the min everytime from min heap at the 100Th time the 100th smallest will come out and again to maintain the heapify property it will be O(logn) so 100 times O(100*logn) so answer will be $\Theta (\log n)$ Pavan Kumar Munnam answered Dec 29, 2016 Pavan Kumar Munnam comment Share Follow See all 8 Comments See all 8 8 Comments reply Show 5 previous comments Pavan Kumar Munnam commented Dec 29, 2016 reply Follow Share i think you are reffering this https://gateoverflow.in/1110/gate2003_23 0 votes 0 votes saurabh rai commented Dec 29, 2016 reply Follow Share yeah.... 0 votes 0 votes Pavan Kumar Munnam commented Dec 29, 2016 reply Follow Share the last line i think $\theta (logn)$ is only correct 0 votes 0 votes Please log in or register to add a comment.