You are viewing a single comment's thread. Return to all comments →
Input: 8 90 13 47 74 12 89 74 18 38
tree(heap) formed for given input: 12 13 18 38 89 74 74 47
in operation 1 deleted nos=12,13
tree: 18 38 38 47 89 74 74
in operation 2 deleted nos=18,38
tree: 38 47 74 74 89 94
in operation 3 deleted nos=38,47
tree: 74 74 89 94 132
in operation 4 deleted nos=74,74
tree: 89 94 132 222
in operation 5 deleted nos=89,94
tree: 132 222 277
Since 132>90, therefore total number of operations required=5. Hope this helps :)
Seems like cookies are disabled on this browser, please enable them to open this website
Jesse and Cookies
You are viewing a single comment's thread. Return to all comments →
Input: 8 90 13 47 74 12 89 74 18 38
tree(heap) formed for given input: 12 13 18 38 89 74 74 47
in operation 1 deleted nos=12,13
tree: 18 38 38 47 89 74 74
in operation 2 deleted nos=18,38
tree: 38 47 74 74 89 94
in operation 3 deleted nos=38,47
tree: 74 74 89 94 132
in operation 4 deleted nos=74,74
tree: 89 94 132 222
in operation 5 deleted nos=89,94
tree: 132 222 277
Since 132>90, therefore total number of operations required=5. Hope this helps :)