Doubt in mcq questiobs

For deleting any arbitrary element from a min heap in what best complexity you can achieve this?

O(1)

O(logN)

O(N)

what will be the answer of this mcq and why?

Q2. Merge Max-Heaps In what best time complexity you can merge two max-heaps? (Assume size of first heap is (m+n) and the second is (n)) O(1) O(m+n) O(logM*logN) O(mn) please tell the method to solve this question also

ans 1 is o(n) @Akshita99 as searching will take o(n) and deleting 0(logn)

ans 2 - Knowing that the time complexity to build a heap from an array with N elements is O(N) in best case…so for (m+n)+n elements, it should be O(m+2n)
So answer should be O(m+n).

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.