Binary Search Trees (BST) Explained in Animated Demo

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024

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

  • @shaqe
    @shaqe 3 หลายเดือนก่อน +11

    9 years later: Still the best.

  • @sogggy
    @sogggy 3 ปีที่แล้ว +230

    That intro music was fire. I was really pumped up to learn about binary search trees.

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

      no fr😂

    • @jeremyl889
      @jeremyl889 ปีที่แล้ว +6

      it's like pregame music got me hyped up

    • @abishekraju4521
      @abishekraju4521 ปีที่แล้ว +5

      Yeah I swear, was like gonna smack some leaves of them trees today.

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

      Hahah, agreed.

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

      Hey! before you do something important, you gotta set the mood right.

  • @LongDistance22
    @LongDistance22 3 ปีที่แล้ว +87

    You explained in 6 minutes what my professor explained for 1.5 hours in my 2 hour class.

  • @waterspray5743
    @waterspray5743 4 ปีที่แล้ว +240

    Thank you for not making it twenty minutes long.

    • @teddy810
      @teddy810 4 ปีที่แล้ว +10

      Try two hours,lol

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

      Eyy, 11 hour videos are all the rage now. Actually, anything north of 11hours has become the norm now.

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

    This video should be on the top of the search results. Clear, short, concise. Thanks, very helpful!

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

    One of the best video! You've covered all base scenarios and explained some advantages too! I love you, mate!

  • @fatimaparada-taboada1372
    @fatimaparada-taboada1372 4 ปีที่แล้ว +49

    SO helpful! That last bit of music did scare me though

    • @s.m.7319
      @s.m.7319 3 ปีที่แล้ว +1

      lol same, did not expect that

    • @dorondavid4698
      @dorondavid4698 3 ปีที่แล้ว

      Programming should scare anyone more, lol

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

      you learned about binary search tree. [Dramatic music plays] . Now you have the power to recreate google! xD

  • @abi_hajdari
    @abi_hajdari 3 ปีที่แล้ว +6

    6 years later but found it really helpful
    Thanks

  • @dr-cake
    @dr-cake 2 ปีที่แล้ว +3

    This is the best explanation of binary search trees. Thanks! 🙏🏻

  • @leeda36
    @leeda36 8 หลายเดือนก่อน

    the SPEED animation was exactly what i needed as i'm remembering the entire algorithm course from 2 years ago in a couple of nights before the finals.

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

    This is so damn good! The animation is very helpful!

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

    Correction in a binary search tree (non-balanced) you say O(h) = O(log n) but worst case for non-balanced is a tree that is only going in one direction: 1,2,3,4,5,6.
    The worst case run time here is O(h) = O(n).
    Just for anyone who might end up confused. In a RB tree we leverage that we constantly rebalance and therefore achieve O(log n)

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

    This explains it very well, thank you.
    Had alot of trouble figuring out how they work since most pages out there have ill-defined terminology.

  • @izagawd
    @izagawd 6 หลายเดือนก่อน

    short, an simple. love it

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

    Best Video on bst so far

  • @xinyili818
    @xinyili818 9 ปีที่แล้ว +6

    Very helpful! Thank you.

  • @a.human.
    @a.human. 2 ปีที่แล้ว

    THE BEST vid on this topic

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

    They seem useful.

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

    This was so helpful!

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

    The explanation is top notchh!

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

    Awesome explanation. Thank you.

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

    Amazing explanation!

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

    Great video, thanks

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

    Thank you Joe

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

    thanks for the explanation

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

    love the music

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

    very good explanation, thanks

  • @MegaRyad
    @MegaRyad 8 ปีที่แล้ว +13

    you have badass entry , if you rise your voice while saying joe james will make it much better

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

      +The Bombardi okay, I'll try that. =)

  • @jean-paulboga8189
    @jean-paulboga8189 2 ปีที่แล้ว +1

    Great job thanks sir

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

    Really cool intro

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

    Thanks so much.

  • @unstable_diffusion
    @unstable_diffusion 4 ปีที่แล้ว +3

    at 4:57 did 25 use uno reverse card against 28.

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

    Thank you.

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

    Thank you

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

    Great!

  • @aleksanderjanjanaleksander524
    @aleksanderjanjanaleksander524 3 ปีที่แล้ว

    epic outro

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

    Thank you so much sir - from Harvard University!

  • @gufengmsa
    @gufengmsa 3 ปีที่แล้ว

    good one!

  • @kim-xq6wr
    @kim-xq6wr 4 ปีที่แล้ว

    thank you!

  • @dazandelea
    @dazandelea 9 ปีที่แล้ว

    Beauty!

  • @dnilbhr
    @dnilbhr 5 ปีที่แล้ว +7

    How did you come up with 30? Log(10,000,000) is not 30.

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

      So, it's even faster.. wow

    • @crisc.castillo979
      @crisc.castillo979 3 ปีที่แล้ว +1

      Shouldnt it be ln(10,000,000)/ln(2) = 23.25 => 24 comparisons?

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

    There was one key thing missing. What happens if you remove the root node?

    • @oggiai
      @oggiai  4 ปีที่แล้ว

      I believe you’ll still have an empty tree

    • @oggiai
      @oggiai  4 ปีที่แล้ว

      I believe you’ll still have an empty tree

    • @chippchirp9096
      @chippchirp9096 3 ปีที่แล้ว

      Removing the root node or nulling it should de-reference the entire tree, effectively clearing it. This is useful if you want to have a clear method within your class.

    • @theoreticalphysics3644
      @theoreticalphysics3644 3 ปีที่แล้ว

      Find the next node in order. 19 would be the next node, so 19 is moved to the root.

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

    Nice

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

    Sounds like George Lucas. Thanks for the help.

  • @anash.shalaby6720
    @anash.shalaby6720 2 ปีที่แล้ว

    what about {14. 6, 11, 32, 7, 23, 25, 13} the tree looks so weird

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

    someone 💨💨 @2:30 🤣

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

      That's how you know this video wasn't made by ChatGPT

  • @nublar3356
    @nublar3356 12 วันที่ผ่านมา

    2:30 quack!
    12 becomes a child of 13, fine. But how come 12 doesn't become a sibling of 13? How can any other 2 children be siblings in the rest of the initial BT if not?

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

    log(10 million) = 16.1, so how ya get 30?

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

      “On the order of 30 comparisons” doesn’t mean exactly 30. It means within a factor of 10. When discussing algorithms the exact number of operations usually doesn’t matter.

  • @jko7654
    @jko7654 3 ปีที่แล้ว

    What's the usage for this?

    • @oggiai
      @oggiai  3 ปีที่แล้ว

      Whenever you need very fast search access to data. For example, an index in SQL.

  • @DewTaydus-yi1ej
    @DewTaydus-yi1ej 5 วันที่ผ่านมา

    Johnson James Miller Sarah Williams Ruth

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

    Rodriguez Sarah Wilson Amy Walker Michael

  • @MstAmica
    @MstAmica 4 วันที่ผ่านมา

    Lopez Larry Rodriguez Amy Harris Amy