@srestha Time taken to find the leaf node?
@ Tesla! Thanks buddy! and thank you srestha Ma'am.
we want to delete any of the leaf node
$O(1)$ will suffice for deleting any leaf node(If you are asked to delete any leaf node and not some specific leaf node)...Just delete the last element.
And how about a particular leaf node apart from last leaf node?
There are approx $\frac{n}{2}$ leaves in the Heap. So, If we wish to delete some Specific leaf node then first we would have to find it, which could take $O(n) $ time itself. Then after finding that leaf we can delete that node in just $logn$ time.
previous of last node , is also a leaf node
Wouldn't be true if $n=2$
There are approx n2 leaves in the Heap. So, If we wish to delete some Specific leaf node then first we would have to find it, which could take O(n) time itself. Then after finding that leaf we can delete that node in just logn time.
So, it's O(n) * O (logn) = O(n), right?
Gatecse