3 votes 3 votes Consider the binary tree shown below, which is an almost max-heap with the node $22$ violating the max-heap property. Once heapify procedure is applied to it, which position will it be in? Algorithms go2025-algorithms-1 numerical-answers binary-heap + – gatecse asked Aug 18, 2020 gatecse 144 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
4 votes 4 votes We need to perform swapping, to get max-heap. Swapped $22$ and $42,$ we get Swapped $22$ and $26,$ we get max-heap. So, the correct answer is $9.$ Lakshman Bhaiya answered Aug 19, 2020 Lakshman Bhaiya comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes $22$ and $42$ will get swapped. Then $22$ and $26.$ So, final position of $22$ will be $9.$ gatecse answered Aug 18, 2020 gatecse comment Share Follow See all 0 reply Please log in or register to add a comment.