retagged by
871 views

2 Answers

1 votes
1 votes
When u want to delete the minimal element . . . Then it is the element with least priority or least key value . . . So when u implement it with a max heap the least value will be in the leaf . . So logn to traverse in the worst case . . Here when u delete the leaf there is no need to heapify it. . As by deleting the leaf the heap property will not disturbed .

So answer is C O(logn)
1 votes
1 votes

O(logn) when Heap data structure is used..

Related questions

0 votes
0 votes
1 answer
1
rahul sharma 5 asked Dec 17, 2016
999 views
How to implement Priority queue using stack?What will be time complexity for Enqueue and Dequeue operations?Edit:- Updated the question clearly
2 votes
2 votes
1 answer
2
A_i_$_h asked Oct 9, 2017
1,221 views
Given that ready contains at some point of time a maximum of n process , the time complexity to schedule and dispatch a process from ready queue onto CPU using priority ...
0 votes
0 votes
1 answer
3
Overflow04 asked Oct 9, 2022
417 views
how O($n^{2}$) in the last.(in the given solution).
0 votes
0 votes
0 answers
4
Overflow04 asked Oct 9, 2022
287 views
Is it really coping operation will take O(n).Does copy is done character by character.means simple code like (in c++) for(int i=0;i<n;i++){s=s;}will take O($n^{2}$)