Thank u god all mighty i couldn't find a SINGLE video to explain this concept quickly and concisely omg!!
@dariuszd62075 жыл бұрын
It was hard to find simple and clear explanation of this problem. Thank you.
@kimberlyjohnson25808 жыл бұрын
This made so much sense! Thank you for explaining it so clearly!
@MarsTheProgrammer9 жыл бұрын
Thanks buddy, you explained it and made it clearer than my professor who has 2 Phds...
@heatxtm7 жыл бұрын
well, having 2 Phds doesn't mean anything one thing is to know something (2 Phds says that) and other thing is to teach or explain
@dghthh21637 жыл бұрын
A phd is not a job training for teachers.
@kadentaylor85035 жыл бұрын
@@dghthh2163 LOUDER FOR THE FOLKS IN THE BACK!
@AlexChambersXYZ10 жыл бұрын
I call you "Zeus" god of the algorithms ruler of data structures thanks man.
@HaloElite8 жыл бұрын
I love you so much for creating this video! Saved my life!
@bobbymcgrath80254 жыл бұрын
Very well explained video and the visual representation was very well illustrated and broken down into a step-by-step formula that made it even easier to understand, thank you sir! :)
@Shobu7 жыл бұрын
much love man. my teacher is a 70 years old who it does not care about students. Thanks a lot !
@botqqq6 жыл бұрын
Perfect and simple explanation. Thank you!
@KnownUser1398 жыл бұрын
I think this guy was sick too..Hats off to you it was a great video
@Burak-pl1jl7 жыл бұрын
Brief and understandable explanation! Thank you. :)
@MorleyDev9 жыл бұрын
Is there a particular reason you traverse the tree starting with the right subtree of 16 first on your tree at 2:00? I thought tree traversals (pre-order, post-order, in-order) put left before right in all cases?
@Z00CE9 жыл бұрын
Nathan Morley, good question. A heap is not like a binary search tree, where pre/post/in-order traversals are useful. When we begin to heapify, we have to start from the very last subtree which starts at the floor(N/2) "root". Remember that when we build a heap, we insert from top to bottom, left to right, that way the tree stays nearly complete, so if we didn't have the last two nodes, we would have started from that left subtree at the bottom. I hope this makes sense...if not, let me know and I can explain further. Thanks for watching!
@ExploreWithNam7 жыл бұрын
Could you please explain how to compute time complexity for this?
@MyVanir5 жыл бұрын
Great explanation, helped me a good bit.
@DrakeLuce7 жыл бұрын
Basically a Khan Academy video. Great job :)
@RafaelNascimento-qo1jp4 жыл бұрын
6 minutes of "visualization" is worth more than 6 hours of explanation
@minkihairoil3 жыл бұрын
Thank you so much this FINALLY makes sense :))
@devinj374 Жыл бұрын
fantastic video!
@向前走五十五步6 жыл бұрын
Super clear. Thank you for the posting.
@vijaydulam588610 жыл бұрын
Awesome Sir ! clear This Topics
@CloudStrife08965 жыл бұрын
Simple as 1-2-3, good job on explaining another thing not done right in Greek universities.
@Simoky995 жыл бұрын
or in brazilian universities
@teeheeee78078 ай бұрын
Thank u so much it helps a lot 💗
@אלעדשגיב4 жыл бұрын
It was a perfect explanation , thank you!
@jontran31947 жыл бұрын
I dont get it. If this is big O(logN) Everytime you max heap something. You mess up the sub tree below. So you have to go back and max heap it again. Isn't it O(n^2)?
@kendellferguson50212 жыл бұрын
Who knew Ben Shapiro would be teaching me Data Structures lol Great Video btw
@diana-hus3 жыл бұрын
Thank you! It was extremely helpful
@saxophone12player10 жыл бұрын
Thanks man !
@coyotulnegru Жыл бұрын
thank you mister
@chagantirbbsrao59304 жыл бұрын
great work!! thanks
@ericknicolasnunesdahora48607 жыл бұрын
Thank you sir!
@elyartaker113922 күн бұрын
wow thank you for this
@minhhuynh26464 жыл бұрын
Thank you man you are great
@transam3518 жыл бұрын
How does the algorithm know when it needs to re-heapify subtrees?
@Z00CE8 жыл бұрын
It always checks the subtree which it swapped with. If that subtree is a max heap (i.e. the child nodes of that subtree are less than the new parent) then it doesn't need to heapify that subtree, otherwise it will re-heapify it, and so on.
@prof.dalmar69898 жыл бұрын
Grt video thanks sir now i understand clearly thnx
@yongkailiu14485 жыл бұрын
Really helpful!!!
@VersatileAnthem5 жыл бұрын
yeah i understood but how to make that understandable to computer
@romansmirnov33518 жыл бұрын
thanks man, that was good
@batuhanbayr7613 Жыл бұрын
KZbin AWARDS GOES TO..
@tusharpandey65844 жыл бұрын
very nice explanation thanks
@Simoky995 жыл бұрын
I finally understood this crap. thanks
@deepakrout67954 жыл бұрын
Which drawing app are you using for lecture?
@43_ayonroy42 жыл бұрын
I have to submit an assignment tomorrow but I also have an exam on the same day. I need help
@ashitpanda29058 жыл бұрын
Ahh thanks for this video. But i must say it could have great if you had described with the algorithm description.
@vikasyadav-og2cg7 жыл бұрын
sir if value is 23 in the place of 5 what should i do???, which value can be swapped???
@lamyagawdat92035 жыл бұрын
god bless you buddy
@natsuvatsan61082 жыл бұрын
What about min heap?
@haisulii5 жыл бұрын
Simple to understand.
@persianshawn926 жыл бұрын
so when we go through each subtree, we always go from right to left?
@jonasgrnbek71134 жыл бұрын
What software is used to create this?
@Aevatheone7 жыл бұрын
Awesome! :D
@karolkarol14307 жыл бұрын
Thank you a lot ;)
@akashaggarwal33828 жыл бұрын
grt video
@JananiAnbarasan6 жыл бұрын
what tool/software do u use to write?
@leadguitar535 жыл бұрын
Isnt subtree 2 still unfinished at the end of the video?
@darshfify10 жыл бұрын
thank you :)
@elie34236 жыл бұрын
not indian: check clear voice: check good video quality: check knows what he is doing: check Thanks bro for the perfect video
@KyleBridenstine10 жыл бұрын
On the third sub-tree where both child nodes are greater than the parent, for some reason I always thought you start with the left child and swap those then you evaluate the right child and if the rights larger you swap those, I didn't know you just pick the one that's the largest :0
@Z00CE10 жыл бұрын
If you took that approach (starting by swapping with the left child) you'd be adding quite a bit of extra, unnecessary computation. Heapify is recursive, so when you swap, you Heapify the subtree that you just swapped with...thus you'd have to come back up to the initial subtree after who knows how many Heapify's of that left subtree, then swap with the right child, and recursively Heapify the right subtree. (Sorry you might have to read that a couple of times...lots of "subtrees" and "Heapify's") I realize that it's difficult to visualize this with the example in the video, but if your Max-Heap was very large, you could see just how much extra work you cut out by simply swapping with the larger of the two. Hope that helps clear things up. Thanks for watching!
@KyleBridenstine10 жыл бұрын
Yeah I thought about that as soon as I saw this video it definitely makes sense this way! Wish me luck on my final tomorrow :(
@Z00CE10 жыл бұрын
Awesome! Good luck!
@fog1257 Жыл бұрын
Thanks!
@mohammadishaqnoori97287 жыл бұрын
thank you Sir
@Alex-ii3me3 жыл бұрын
Thanks!!!
@cav3man828 жыл бұрын
didn't you just go through the whole build heap function (and not just max-heapify on a particular node)?
@Z00CE8 жыл бұрын
Yep
@elliotgehin9 жыл бұрын
Cheers m'dears
@abdulmalikjahar-al-buhairi97545 жыл бұрын
HEEELP I UNDERSTAND THIS BUT I HAVE PSEUDO CODE THAT DOES THIS TOP DOWN! Why would you do that to me prof?! Isnt it stupid to go top down? You have to make redundant checks? Or doesnt it matter?
@qwertek8413 Жыл бұрын
thanks ;)
@Lukas-bb4sg Жыл бұрын
Thanks
@nishantingle14385 жыл бұрын
Someone please give me iterative code for max heapify.
@allenyin76306 жыл бұрын
A binary heap is not nearly a complete binary tree. It is a complete binary tree.
@MaleeshaHuththo3 жыл бұрын
Ben Shapiro before he was famous. jokes aside, this was very informative.
@zilinli1874 жыл бұрын
save my life for only 6min
@ORagnar4 жыл бұрын
So, you are pushing the maximum value to the top by this method.
@Z00CE4 жыл бұрын
Yep, that's correct. And to be even more correct, every "parent" value is greater than (or equal to) it's "child" values.