Algorithms | Sorting Techniques | Max heapify algorithm and complete binary tree|Ravindrababu Ravula

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

for 3-ary, max no of nodes with height is-        (3^(h+1)  -  1)/2,
   and for n-ary it is- (n^(h+1)-1)/(n-1).

parthpercy
Автор

Awesome sir your way of teaching is brilliant.i wish i was your student :) #UserFromPakistan

shahzaibhayatkhan
Автор

Your lectures are amazing.
Great content sir!
thanks helped a lot

dikshabhatia
Автор

Excellent explanation, Sir. For all those who are thinking when will the recursion stop, this is the answer:

When the index of left child/right child becomes more than Heap Size, then there is no changes in the value of "largest". Hence, the condition (largest != i) does not satisfy thereby ensuring that the function is not recursively called again. It might happen that the index left child/right child is not more than Heap Size but the "largest" remains unchanged(indicating it is already a Max Heap). Even in this case, the recursion stops. Hope it clears your doubt. :)

nilashishchakraborty
Автор

awesome, the only useful explanation of heap sort I found

aarushijain
Автор

For all those who are blabbering that "this algorithm does not work for half part of the tree"
At 25:49 sir, himself told that this algorithm applies when left sub tree is a max heap, right sub tree is a max heap and only thing we have to check is whether the root is max heap or not.
Please guyz refer the video and stop making assumptions.

himanshupoddar
Автор

sir, this is the perfect explanation that student thank you.

aiyushshivhare
Автор

max-heapify means given an array - we have to rearrange it so that the resultant array satisfy max heap properties

aabid
Автор

once again i m watching..just before exams..you make things simple..my fav teacher

soniasmelodiousland
Автор

U have that art to deliver exact concepts to other people...!! Indeed nicely explained..!! Cheers

vibhavkushwaha
Автор

Dear Sir, your lectures are very much addictive. I feel like keep watching and learning from you. Thank you for the awesome information

dotnetforall
Автор

i was searching for a really long time why we compared the L and R with the heapsize but i didn't find an answer till i saw your vid ♥
thank you so much

ahmedhatem
Автор

i wish every teachers are like you, i mean by the way of teaching. thank you sir for free videos.

aishwaryaroychoudhury
Автор

37:35, are we not passing the index of largest(2 in this case) in the max_heapify fun, if i pass largest then value will be passed, but we need to send the index, right?

habibremon
Автор

Hi Ravindra, ,
Great explanation! .. in very simple terms. Outstanding Job!!

seeklongterm
Автор

sir it was an excellent lecture not this all your video are best plz make more n more video it is very helpful for preparing for gate exam thank you sir

rajtripathi
Автор

AT 26:01, the A.heap-size = 0. How the pseudo code be able to work???? It should be A.length()

daitavan
Автор

One doubt in max-heapify, how do you know that the left and right subtree are max-heaps when you are starting at the root node in the example?

vaibhavjade
Автор

for 3-ary tree the no of nodes will be=((3^(h+1))-1)/2
and for n-ary tree the no of nodes will be=((n*(h+1))-1)/(n-1)
where n stands for n-ary tree(2, 3..) and h is height of tree

akka
Автор

can someone explain, why he did not start from the last non-leaf node and go up for max heapify?

ramprasath