0 votes 0 votes consider the min heap tree.minimum number of comparisons to required to maintain the heap property after deletion of root are according to me 3, because we just need to check b/w the 2 childs as parent will be definitely greater than both of its children! am i wrong? Gate Fever asked Jan 5, 2019 Gate Fever 600 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply prashant jha 1 commented Jan 5, 2019 reply Follow Share Can you share procedure with diagram of your way? 0 votes 0 votes Gate Fever commented Jan 5, 2019 reply Follow Share how much are u getting? @prashant jha 1 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes I think total comparisons are 5 between 196-120 196-130 then 196-160 196-170 then 196-195 Nandkishor3939 answered Jan 5, 2019 Nandkishor3939 comment Share Follow See all 2 Comments See all 2 2 Comments reply Gate Fever commented Jan 5, 2019 reply Follow Share why 195?? 0 votes 0 votes Gate Fever commented Jan 5, 2019 reply Follow Share actually my doubt was- why to compare 196 with 120 and 196 with 130; i mean why not compare just 120 & 130 , and move the smaller one to parent node see as it is a min heap the last element (196) will definitely be greater than 120 & 130; so why to compare the element of last level with element in 2nd level??element of last level will definitely be greater than element in 2nd level, so why to do comparison!! got my question??? 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes no of comparision is =3 i.e is 196 to 120, 196 to 140, 196 to 180 gorya506 answered Aug 14, 2019 gorya506 comment Share Follow See all 0 reply Please log in or register to add a comment.