Heaps in 3 minutes - Intro

Sdílet
Vložit
  • čas přidán 29. 08. 2024
  • Introduction to heaps in 3 minutes.
    Code: github.com/msa...
    Sources:
    1. Introduction To Algorithms, Third Edition (CLRS) [www.amazon.com...]
    2. www.quora.com/...
    3. stackoverflow....
    LinkedIn: / michael-sambol

Komentáře • 69

  • @MichaelSambol
    @MichaelSambol  Před 2 lety +22

    In the discussion on height, it's worth noting that nearly complete binary trees are balanced and thus have a height of O(logn). Regular binary trees may become unbalanced, at which point this would no longer apply.

  • @de-stressmusic432
    @de-stressmusic432 Před 10 měsíci +62

    If you count array from 0, left = 2i + 1, right 2i + 2, parent Math.floor(i-1/2)

  • @jeevesmcqueeves
    @jeevesmcqueeves Před rokem +38

    Instantly subscribed because it's a breath of fresh air to have a slow-paced (yet short and concise) explanation of a concept. I feel like I have time to actually understand what is being explained.

    • @MichaelSambol
      @MichaelSambol  Před rokem +3

      Thank you! 👊🏼

    • @FaridTaba
      @FaridTaba Před 10 měsíci +2

      Came here to comment the exact same thing!! Thank you for not editing out all the pauses 🙏

  • @unknownman1
    @unknownman1 Před 2 lety +45

    please don't go away this time. I remember watching your tutorials 4 years back.

  • @zeeg1529
    @zeeg1529 Před 10 měsíci +7

    really appreciate the pacing and mentioning heaps for memory management first to avoid confusion. great content!

  • @abhishekmoramganti3471
    @abhishekmoramganti3471 Před rokem +6

    You are probably one of the best educators out there man! These types of videos make these concepts way less intimidating to approach.

  • @jays.3702
    @jays.3702 Před 3 měsíci +2

    This is such a fire way to teach coding concepts. Keep it up man

  • @jasonleng2490
    @jasonleng2490 Před 2 dny

    Your channel deserves way more subscriptions.

  • @kamylamarinho4868
    @kamylamarinho4868 Před rokem +2

    Hey man, I wanted to thank you, you taught me in a simple and efficient way the subject that my teacher has been teaching for 2 months!!

  • @rongitmukherjee
    @rongitmukherjee Před 2 měsíci

    Best explanation I've found till now

  • @eriksoto8512
    @eriksoto8512 Před 5 měsíci

    what an insanely good video to find while studying and writing notes for a final

  • @usualguy7583
    @usualguy7583 Před 7 měsíci

    Really easy to understand and straight to the point. I appreciate the video a lot

  • @dameongraham4444
    @dameongraham4444 Před 2 lety +3

    My gosh man!! You’re amazing!! Keep it coming…🙏🏾🙏🏾

  • @udayrajvadeghar8555
    @udayrajvadeghar8555 Před měsícem +1

    Extremely helpful!! Thank you !! :)

  • @alliesteele6282
    @alliesteele6282 Před rokem

    Criminally underrated, thank you!

  • @antonkomaristyy3562
    @antonkomaristyy3562 Před 2 dny

    this is goated, deserves all the likes

  • @paulinaanna5
    @paulinaanna5 Před 9 měsíci

    i spent 2 hours in a lecture to hear about this concept. I understood your 2 mins explanation better

  • @mohammadahmedragab837
    @mohammadahmedragab837 Před 3 měsíci

    easy to understand ,consice and in the same time detailed and I like your explanation :")

  • @meepmoop42
    @meepmoop42 Před 5 měsíci

    studying for my data structures final and ur videos are so incredibly helpful :]

    • @MichaelSambol
      @MichaelSambol  Před 5 měsíci +1

      Nice! Go crush your test 💪🏼❤️

  • @MarcoAurelio-sv2tk
    @MarcoAurelio-sv2tk Před měsícem

    Excellent explanation!!!

  • @asif.haswarey
    @asif.haswarey Před rokem +2

    First off, nice video!
    2:18 : Would help visually for you to show the indices (indicated by i in the formulas) in small font next to each of the nodes. For example:
    Node 21 : i = 0
    Node 17 : i = 1
    Node 14 : i = 2
    Node 12 : i = 3
    Node 8 : i = 4
    Node 1 : i = 5
    Lastly, using the light-green and cyan-blue colors might be difficult to clearly distinguish for color impaired viewers. But then there's the problem with yellow and light red.
    Tritanomaly : Blue/Green, Yellow/Red,
    Tritanopia : Blue/Green, Purple/Red, Yellow/Pink
    O boy! Nevermind!

  • @user-fk1wo2ys3b
    @user-fk1wo2ys3b Před rokem

    You are a great teacher, what a talent, THANKS!!!

  • @SirArtorias
    @SirArtorias Před 2 lety

    Oh boy, a gift from God, tomorrow is my exam lol

  • @servantofthelord8147
    @servantofthelord8147 Před rokem

    So concise. Ugghh, I love it 👍

  • @LilJollyJoker
    @LilJollyJoker Před 8 měsíci +1

    Thank You!

  • @user-wy1br4le3i
    @user-wy1br4le3i Před měsícem +1

    The sound here is scary, almost had a panic attack.

  • @macolulu
    @macolulu Před 7 měsíci

    This is so great

  • @anshikagaur2156
    @anshikagaur2156 Před 4 měsíci

    hey , for left u said its 2*i and the answer comes out index 6 but while considering 2n+1 for left , answer comes out index 7 , why?

  • @fernandofa2001
    @fernandofa2001 Před 2 lety +2

    Your videos are fantastic! But how do you have so few views for all the subscribers you have?

  • @NickWinters
    @NickWinters Před 3 měsíci

    Why are heaps sometimes called nearly complete binary trees? How is that relevant? I learned that heaps are sorted binary trees. It shouldn't matter if they are nearly or fully complete, or drastically incomplete then. And it's not like all nearly complete binary trees are heaps. I don't understand.

  • @ironmonkey1990
    @ironmonkey1990 Před 5 měsíci

    Thank you!

  • @NoName-rq6bg
    @NoName-rq6bg Před 5 měsíci +1

    The MLS clearly has the beat Logos🔥 they look kinda like city or state logos. Logos from the other leagues look too much like school logos

  • @mrmansir3734
    @mrmansir3734 Před rokem +1

    Is a max-heap the same as just a heap?

    • @renderscott
      @renderscott Před rokem

      I think a "regular" heap is a min-heap

  • @zakyoung2374
    @zakyoung2374 Před 2 lety

    Appreciate you man

  • @narenbabu629
    @narenbabu629 Před rokem

    What is the intution behind naming the Heap data structure.
    What is called a heap in Heap data structure?

    • @happilyevernever4289
      @happilyevernever4289 Před 11 měsíci

      heap: an untidy collection of objects placed haphazardly on top of each other.

  • @CptColCool
    @CptColCool Před rokem

    2:19 Whoa, what is this dark magic 😲

  • @colin9112
    @colin9112 Před 2 lety

    well done

  • @JvMapote
    @JvMapote Před 2 lety

    Thank you soo much

  • @D3ebK
    @D3ebK Před 2 lety

    Next stop 60k!

  • @xPorkchops007x
    @xPorkchops007x Před rokem

    0:30 I thought that was a complete binary tree that is nearly full, not nearly complete

  • @goodhuman1
    @goodhuman1 Před 2 lety +1

    Wow

  • @leonh2140
    @leonh2140 Před rokem

    Why is the title of the video translated into german?

  • @voilin
    @voilin Před 10 měsíci

    no way I found a video less than 10 minutes

  • @noswag5773
    @noswag5773 Před 11 měsíci

    ❤❤

  • @ecmrn
    @ecmrn Před 5 měsíci

    He's cute and he's smart.

  • @user-ri3yl7sd5l
    @user-ri3yl7sd5l Před 10 měsíci

    hi

  • @xxbshiixs
    @xxbshiixs Před rokem

    Currently really angry at him so I thought I‘m going to study a bit and learn about heap.
    Yeah I‘m now more angry