Heaps in 6 minutes — Methods

68,423
0
Published 2022-07-06

All Comments (21)
  • @MichaelSambol
    The "height of binary tree" slide should read "height of nearly complete binary tree." Regular binary trees may become unbalanced and thus not have a height of O(logn). Because heaps are nearly complete binary trees (which are balanced), we know that the height is O(logn).
  • If you are reading this comment, I would like to say thank you for your educational content. You helped me pass Algorithms with a grade of B.
  • @DancingHippo
    Micheal is singlehandedly helping every single computer science student pass this exam
  • @Fuego958
    Love your videos. Short, clear, and no frills.
  • @dannggg
    You always makes things clear
  • @josecalles7634
    Bro, really thanks to give so clean a very good explained things, you're literally save my life
  • @BABEENGINEER
    Absolutely appreciate your visual explanations!!!
  • @Xxnightwalk1
    I really enjoy the bite sized nature of your videos It really helps me understand the concept, and I then know about it for future research if need be Thanks a lot for your content
  • @NickWinters
    Thanks! Very useful video, it clarified some things for me
  • @govindrai93
    It would be great if you can also show methods for adding elements into the heap and removing them and the complexities involved there. Thanks!
  • @user-jt4hk1rl8r
    I don’t understand why build max heap is not nlogn in run time since u run max heapify on n nodes
  • @narenbabu629
    typo at 5:01 last line is max_heapify(a, 5, i) instead it should be max_heapify(a, 10, i)
  • @darknessbleed
    whats the purpose of l<heap_size t 3:16 . Also what's the difference between max_heapify and build_max_heap ?
  • @govindrai93
    Hey Michael! What a great video! This six minute video actually took me a few hours to really gain understanding. :D QQ: You state at 5:29 that the run time is O(n) but in each iteration of the for loop you call max_heapify which has a run time of log(n). Being that, shouldn't the runtime be 0(n * log(n))? Thank you?
  • @mayanksingh9407
    just a little doubt, in maxheapify shouldnt it be if la[largest]
  • @01eksii
    Oh yeah, another addition to collection of golden clasics
  • @DemosthenesKar
    I think there is a mistake at 3:24, for 9 to float down we need to keep using i in the recursive max_heapify, not the largest which is now 18