2 votes 2 votes I think its none of the above? DS ace-test-series data-structures binary-heap + – rasto mapp asked Jan 21, 2018 recategorized Mar 3, 2019 by I_am_winner rasto mapp 630 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply MiNiPanda commented Jan 21, 2018 reply Follow Share I think option C .. 0 votes 0 votes rasto mapp commented Jan 21, 2018 reply Follow Share how is that?? Isnt it mlog(n+m). 0 votes 0 votes MiNiPanda commented Jan 21, 2018 reply Follow Share If it's option C I can tell you my approach..what is the answer given? 0 votes 0 votes rasto mapp commented Jan 21, 2018 reply Follow Share Given as C 0 votes 0 votes MiNiPanda commented Jan 21, 2018 reply Follow Share Okay..since they said that the elements are not inserted one by one so we can think like all the elements are added together. Heap uses array data structure right..so append those m elements after n elements. Now total size of heap is m+n. Apply build heap on it. You answer would have been correct if the elements were added one by one. 3 votes 3 votes rasto mapp commented Jan 21, 2018 reply Follow Share Got it now.Thnks :) 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes 0(m+n) not necessarily 1 after the other is given Psy Duck answered Aug 23, 2022 Psy Duck comment Share Follow See all 0 reply Please log in or register to add a comment.