2 votes 2 votes Algorithms algorithms time-complexity test-series + – thepeeyoosh asked Jan 11, 2018 retagged Jul 17, 2022 by makhdoom ghaya thepeeyoosh 1.0k views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments thepeeyoosh commented Jan 11, 2018 reply Follow Share this link doesn't open any question. please check the link. 0 votes 0 votes Mk Utkarsh commented Jan 11, 2018 reply Follow Share ohh that's because one has to attempt that test to access the question :| 0 votes 0 votes Nakul Bhardwaj commented Jul 10, 2018 reply Follow Share Build heap : O(n) Ex :To find 2nd minimum Delete root 2 times - 2*log(n) To find rth minimum - r*log(n) Total complexity: O(n + r*log(n)) = O(n) (since r<n and some constant therefore n is asymptotically larger than r*log(n) ) 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes the ans is o(nlogr) because .... first we build a heap and then one by one we get logr times required to call and balance it adi037raj answered Dec 5, 2018 adi037raj comment Share Follow See all 0 reply Please log in or register to add a comment.