0 0 votes https://gateoverflow.in/459/gate2008-47 here if we insert all elements together and then call heapify function then it’ll take O(logn) time. why answer is O(n)? Algorithms binary-heap + – aditi19 686 views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply kumar.dilip commented Dec 4, 2018 reply Follow flag aditi19 if you call the Heapify then for n element then it will take = O(n log n) time. The Solution of this problem is Take All the 2*n element and call the Build Heap(). So, It will take O(2n) = O(n) time. 1 1 replyShare aditi19 commented Dec 4, 2018 reply Follow flag oh ok 0 0 replyShare Please log in or register to add a comment.