recategorized by
748 views
2 votes
2 votes

recategorized by

1 Answer

0 votes
0 votes
The delete procedure is similar to a normal heap data structure with little modifications.

Consider deletion of min element i.e. the root element at level 0.

Root element then must be replaced by last element of lower most even level after which HEAPIFY procedure can be called considering only even levels of the min-max heap. This procedure will be O(logn).

Similarly deletion of max element i.e one of the two elements in level 1 will cost O(logn) which will consider only odd levels in its HEAPIFY procedure.

Related questions

1 votes
1 votes
1 answer
2
Aboveallplayer asked Jan 19, 2017
929 views
A program takes input of a binary tree with N nodes and computes a function f(x)=max height of left subtree-max height of right subtreewhat is the time complexity?
2 votes
2 votes
3 answers
3
1 votes
1 votes
2 answers
4
CHïntän ÞäTël asked Dec 10, 2018
1,011 views
four vertices {A,B,C,D} is given which has only vertex D as a leaf total number of binary tree are possible when every binary tree has four node!