0 votes 0 votes Which method is correct for building max- heap ...why other one is wrong ?? jatin khachane 1 asked Jul 31, 2018 jatin khachane 1 239 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes In bulid heap heapify is apply to a node only if its children node is heapify. So heapify must be perfome in bottom up order. So at first construct a binary tree. After perfome heapify on bottom up order. So second one is right. abhishekmehta4u answered Jul 31, 2018 abhishekmehta4u comment Share Follow See 1 comment See all 1 1 comment reply jatin khachane 1 commented Jul 31, 2018 reply Follow Share Why 1st is not correct ..everytime insert is called on heap and compared till root upward 0 votes 0 votes Please log in or register to add a comment.