Heaps in 3 minutes - Intro

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ส.ค. 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

ความคิดเห็น • 69

  • @MichaelSambol
    @MichaelSambol  2 ปีที่แล้ว +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 10 หลายเดือนก่อน +62

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

    • @skringli
      @skringli 8 หลายเดือนก่อน +1

      Thank you!!! 🙏🙏

    • @danieltascu7020
      @danieltascu7020 3 หลายเดือนก่อน +1

      thanks

    • @Shinn-sy6jf
      @Shinn-sy6jf 6 วันที่ผ่านมา

      parent = Math.floor((i-1)/2)

  • @unknownman1
    @unknownman1 2 ปีที่แล้ว +45

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

  • @jeevesmcqueeves
    @jeevesmcqueeves ปีที่แล้ว +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  ปีที่แล้ว +3

      Thank you! 👊🏼

    • @FaridTaba
      @FaridTaba 10 หลายเดือนก่อน +2

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

  • @zeeg1529
    @zeeg1529 10 หลายเดือนก่อน +7

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

  • @abhishekmoramganti3471
    @abhishekmoramganti3471 ปีที่แล้ว +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 3 หลายเดือนก่อน +2

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

  • @jasonleng2490
    @jasonleng2490 วันที่ผ่านมา

    Your channel deserves way more subscriptions.

  • @kamylamarinho4868
    @kamylamarinho4868 ปีที่แล้ว +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 2 หลายเดือนก่อน

    Best explanation I've found till now

  • @eriksoto8512
    @eriksoto8512 5 หลายเดือนก่อน

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

  • @alliesteele6282
    @alliesteele6282 ปีที่แล้ว

    Criminally underrated, thank you!

    • @MichaelSambol
      @MichaelSambol  ปีที่แล้ว +1

      haha thank you! tell your friends

  • @usualguy7583
    @usualguy7583 7 หลายเดือนก่อน

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

  • @paulinaanna5
    @paulinaanna5 9 หลายเดือนก่อน

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

  • @dameongraham4444
    @dameongraham4444 2 ปีที่แล้ว +3

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

  • @mohammadahmedragab837
    @mohammadahmedragab837 3 หลายเดือนก่อน

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

  • @meepmoop42
    @meepmoop42 5 หลายเดือนก่อน

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

    • @MichaelSambol
      @MichaelSambol  5 หลายเดือนก่อน +1

      Nice! Go crush your test 💪🏼❤️

  • @antonkomaristyy3562
    @antonkomaristyy3562 2 วันที่ผ่านมา

    this is goated, deserves all the likes

  • @asif.haswarey
    @asif.haswarey ปีที่แล้ว +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!

  • @udayrajvadeghar8555
    @udayrajvadeghar8555 หลายเดือนก่อน +1

    Extremely helpful!! Thank you !! :)

  • @MarcoAurelio-sv2tk
    @MarcoAurelio-sv2tk หลายเดือนก่อน

    Excellent explanation!!!

  • @user-fk1wo2ys3b
    @user-fk1wo2ys3b ปีที่แล้ว

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

  • @SirArtorias
    @SirArtorias 2 ปีที่แล้ว

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

  • @user-wy1br4le3i
    @user-wy1br4le3i หลายเดือนก่อน +1

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

  • @servantofthelord8147
    @servantofthelord8147 ปีที่แล้ว

    So concise. Ugghh, I love it 👍

  • @LilJollyJoker
    @LilJollyJoker 8 หลายเดือนก่อน +1

    Thank You!

  • @fernandofa2001
    @fernandofa2001 2 ปีที่แล้ว +2

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

    • @MichaelSambol
      @MichaelSambol  2 ปีที่แล้ว

      thank you!
      help me spread the word :)

    • @fernandofa2001
      @fernandofa2001 2 ปีที่แล้ว

      @@MichaelSambol sure thing pal, keep it up!

  • @macolulu
    @macolulu 7 หลายเดือนก่อน

    This is so great

  • @NickWinters
    @NickWinters 3 หลายเดือนก่อน

    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.

  • @anshikagaur2156
    @anshikagaur2156 4 หลายเดือนก่อน

    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?

  • @ironmonkey1990
    @ironmonkey1990 5 หลายเดือนก่อน

    Thank you!

  • @NoName-rq6bg
    @NoName-rq6bg 5 หลายเดือนก่อน +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

  • @zakyoung2374
    @zakyoung2374 2 ปีที่แล้ว

    Appreciate you man

  • @mrmansir3734
    @mrmansir3734 ปีที่แล้ว +1

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

    • @renderscott
      @renderscott ปีที่แล้ว

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

  • @CptColCool
    @CptColCool ปีที่แล้ว

    2:19 Whoa, what is this dark magic 😲

  • @colin9112
    @colin9112 2 ปีที่แล้ว

    well done

  • @narenbabu629
    @narenbabu629 ปีที่แล้ว

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

    • @happilyevernever4289
      @happilyevernever4289 10 หลายเดือนก่อน

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

  • @JvMapote
    @JvMapote 2 ปีที่แล้ว

    Thank you soo much

  • @D3ebK
    @D3ebK 2 ปีที่แล้ว

    Next stop 60k!

  • @leonh2140
    @leonh2140 ปีที่แล้ว

    Why is the title of the video translated into german?

    • @MichaelSambol
      @MichaelSambol  ปีที่แล้ว

      Default should be English. Is it not?

  • @xPorkchops007x
    @xPorkchops007x ปีที่แล้ว

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

  • @goodhuman1
    @goodhuman1 2 ปีที่แล้ว +1

    Wow

  • @voilin
    @voilin 10 หลายเดือนก่อน

    no way I found a video less than 10 minutes

  • @noswag5773
    @noswag5773 11 หลายเดือนก่อน

    ❤❤

  • @ecmrn
    @ecmrn 5 หลายเดือนก่อน

    He's cute and he's smart.

  • @xxbshiixs
    @xxbshiixs ปีที่แล้ว

    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

  • @user-ri3yl7sd5l
    @user-ri3yl7sd5l 10 หลายเดือนก่อน

    hi