We have a binary heap on n elements and wish to insert n more elements (not necessarily one after another) into this heap. The total time required for this is?

We have a binary heap on n elements and wish to insert n more elements (not necessarily one after another) into this heap. The total time required for this is

Hi @pssharma1410
If we have already made a heap of n elements and now inserting another n elements in one shot, then it should still take O(n) time, because we can put all elements at once in the array and then use heapify bottom-up which would take O(n). But we are not given the elements at once, then we need to insert an element and run heapify for an element and so on, then it should take O(n∗logn)