0 votes 0 votes Consider a complete binary tree where the left and right subtrees of the root are max- heaps. The upper bound of the no. of operations to convert the tree to a heap is: (a) Ω (log n) (b) Ω (n) (c) Ω (n log n) (d) Ω (n2) RAJESHWAR YADAV asked Feb 4, 2017 RAJESHWAR YADAV 241 views answer comment Share Follow See 1 comment See all 1 1 comment reply bad_engineer commented Feb 4, 2017 reply Follow Share logn 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Just apply the Max-Heapify procedure on the root. It will convert it into max-heap. It will take order of (log n) time. Note: To apply the heapfiy procedure on any node. The necessary condition is that both left subtree and right subtree should be max/min heap. Hemant Parihar answered Feb 4, 2017 Hemant Parihar comment Share Follow See all 0 reply Please log in or register to add a comment.