recategorized by
514 views

1 Answer

1 votes
1 votes
you just need to search it first, O(n) & then delete(swap it with last element and call heapify which will take log(n).

T(n) = O(n + log(n))

Related questions

0 votes
0 votes
1 answer
1
saurav raghaw asked Dec 22, 2018
694 views
The time complexity of the most efficient algorithm to determine whether an arbitrary array of size ‘n’, is min-heap or not?(A) O(log n)(B) O(n)(C) O(n logn)(D) O(1)
1 votes
1 votes
1 answer
2
Avijit Shaw asked Dec 21, 2018
4,409 views
What is the time complexity of 'deleting any random node from a max or min heap'?
1 votes
1 votes
1 answer
3
gmrishikumar asked Dec 1, 2018
2,308 views
What is the time complexity to find the Kth largest element in a Min-Heap? Or equivalently, What is the time complexity to find Kth smallest element in Max-Heap?
0 votes
0 votes
0 answers
4
srestha asked Aug 16, 2018
1,054 views
a)Deletion of smallest element in heapb)Insertion of an element in a heap will take$O(n)$ or $O(logn)$ time?