retagged by
329 views

1 Answer

0 votes
0 votes

@_Madhuri

Heap is a Binary Search Tree (almost) and maintain few important properties to maintain the Heap order…

## Root has the largest element

### Since It is a Binary Search Tree - right subtree is also heap and left subtree is also a heap and maintain the heap property.

#### Right subtree value and Left subtree value is less than or equal to the Root of the Heap.

The main job of Max Heapify is to correct the heap order , meaning, if any subtree does not maintain the heap order, correct the order by shifting the nodes of heap. In this process the tree can get skewed which is the worst case for heap and worst case analysis for the max heapify algorithm...

Total running time for Max Heapify is O(h) + c ...

where h is height of tree and c is number of time you call Max Heapify.

Also, Heap is a tree then , O(h) == O(log n),

because h <= log n Now, the recurrence relation depict the same , that is , the effort to maximize the tree.

T(n) = T(2n/3) + O(1)..

 

1. https://gateoverflow.in/43251/Recurrence-relation-heapify-function-heapsort-algorithm

 

Related questions

1 votes
1 votes
0 answers
1
srestha asked May 19, 2019
638 views
Let $A(n)$ denotes the number of $n$ bit binary strings which have no pair of consecutive $1’s.$ what will be recurrence relation for it and what will be it’s Time Co...
0 votes
0 votes
1 answer
2
jatin khachane 1 asked Jan 2, 2019
352 views
Let T(n) be a function defined by the recurrence T(n)=2T(n/2)+√n for n≥2 andT(1)=1Can someone please explain solution of this using back substitution
0 votes
0 votes
3 answers
3
aditi19 asked Oct 6, 2018
1,149 views
what is the recurrence relation for merge sort?
0 votes
0 votes
2 answers
4
Verma Ashish asked Sep 19, 2018
752 views
How to solve the given recurrence relation using master's theorem?T(n)=T(${n^{1/2}}$)+n