Binary Search Tree in Python

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ • 56

  • @SaifyKhan-o9v
    @SaifyKhan-o9v 10 місяців тому +29

    No BS, no time wasting, no unnecessary talk. Straight to the point. Beautiful. W channel.

  • @-CSE-ArnabSannigrahi
    @-CSE-ArnabSannigrahi Рік тому +12

    There is literally no one who has taught this concept in python this easily so far in my knowledge.......thnank you

  • @Daviesdev
    @Daviesdev 2 роки тому +13

    I love how you do things fast and don't make a big deal about writing good code

  • @PepperingthePolls
    @PepperingthePolls 8 місяців тому +5

    I never think that anyone teach BST so fast and clearly, but he is.

  • @JordHaj
    @JordHaj 2 роки тому +5

    At around 4:39 I think "if not self.value:" will only work as intended if we already know that we deal only with non-zero numbers(not 0 and 0.0) and non-empty iterables(not ( ,), [ ] and "") as they all will evaluate to False and we will be replacing that 0(or whatever) with value but not None which is the default and we don't want. In most cases, the "if not x:" and "if x is None:" structures are interchangable(again, non-zero numbers and non-empty iterables) but you really need the understanding when to use which one
    Edit: for the iterables, it could work if we make some custom parent class of the iterable which we implement comparing methods in, but what I mentioned before still applies to numbers

  • @nvaishnavipai
    @nvaishnavipai Рік тому +2

    Literally best video ,i have watched like 10 other channels. i understood the best with this one! Thank you!

  • @024_habeeb7
    @024_habeeb7 Рік тому +1

    better than anything out there on the internet. great work man
    ]

  • @Torvating
    @Torvating 2 роки тому +10

    If you had posted this video 5 days ago. I would for sure be able to pass my exam on algorithm :c

  • @scullyy
    @scullyy 2 роки тому +5

    14:25 Why do you suddenly need to return the function call? Isn't it enough to simply call the function like you've done up until this point.

  • @Lerka-ok5ey
    @Lerka-ok5ey Рік тому +1

    Thank you so much, this was really helpful! Spent ages trying to work this out before coming across this video)

  • @itsJustJayMusic
    @itsJustJayMusic Рік тому

    Maaaan ! God Bless You . May Your Loved Ones Live Forever Alongside with you

  • @canvasnature3282
    @canvasnature3282 Рік тому +4

    Awesome video finally a good one that helped me grasp the concepts. Thank You😊

  • @coolkaw4497
    @coolkaw4497 Рік тому

    W video i watched a ton of videos on search trees and this is the only one that made complete sense!!

  • @Лена-в1н6ы
    @Лена-в1н6ы 11 місяців тому

    Thank you! For greener like me it was so much understandable!

  • @islamic_insights_daily
    @islamic_insights_daily 2 роки тому

    thank you so much for this man, respect from Algeria

  • @scottlee38
    @scottlee38 2 роки тому +1

    Finally a tutorial on how to actually use this thing.

  • @MadiyarZhunussov
    @MadiyarZhunussov 2 місяці тому

    thank you for the video! it was really helpful to get the grasp on it

  • @TheAveDavid
    @TheAveDavid 7 місяців тому

    Thank you, your explanation was super clear and super helpful!

  • @musicsoul344
    @musicsoul344 Рік тому

    Finally found amazing explanation of binary tree implementation. Wow

  • @watson7813
    @watson7813 Рік тому +1

    Thank you so much! Absolute godsend!

  • @simpledataengineer5231
    @simpledataengineer5231 Рік тому

    you should be teaching CS at MIT dude! amazing video!

  • @EveliseGuenda
    @EveliseGuenda 5 місяців тому +1

    You are the BESTTTTTTTT‼

  • @LilJollyJoker
    @LilJollyJoker 8 місяців тому +1

    Amazing Vid!

  • @AnonYmous-pi1su
    @AnonYmous-pi1su 2 роки тому +1

    Nice, thx for all your hard work making tutoring videos

  • @callme_arafat
    @callme_arafat 8 місяців тому

    Your Video was Very Helpfull...

  • @EBEAST-tb1et
    @EBEAST-tb1et 6 місяців тому

    Great help cheers mate

  • @timtim1333
    @timtim1333 Рік тому

    Thank you for providing value

  • @Jelvix
    @Jelvix 2 роки тому

    Great...good job!

  • @Zethos-qe2nj
    @Zethos-qe2nj 9 місяців тому

    This guy is the goat

  • @RishiRajvid
    @RishiRajvid 2 роки тому

    you are a very awesome teacher

  • @kumaryendamuri1599
    @kumaryendamuri1599 2 місяці тому

    well explained

  • @doudline2662
    @doudline2662 Рік тому

    Thank you sir.

  • @abhinavchoudhary6849
    @abhinavchoudhary6849 2 роки тому

    Awesome bro

  • @jackshone7970
    @jackshone7970 Рік тому

    I don't understand how your traversals ever printed anything but the most left node? It's clearly my thinking thats wrong, I'm aware, but you never go back up one after printing, so how does it happen?

    • @scottmcfarland7842
      @scottmcfarland7842 Рік тому +6

      Hey, I think I can help you if you still don't understand it. Think of recursive functions like this: each time that the function gets called but hasn't made it to the last line of code, there is a function that hasn't been completed yet. That function will be waiting in the computer's memory for its time to continue where it left off. In his example where the root node is 10, by the time we get to Node 1 there are 4 unfinished function calls.
      Node 1 is the first node where self.left is no longer True or in other words where a left node doesn't exist. We print the value of the current node which is 1 and continue to check if there is a right node. There is no right node so that essentially terminates that function call.
      We then return to the most recent function call from Node 2. Upon returning to this function call we continue where it stopped. We had already checked if the left node exists so the next line of code gets executed which is the print statement. This prints the current value which is 2 and now we check if a right node exists. A right node does exist so we call the inorder traversal function on the right node.
      Left doesn't exist for node 3 so we print 3 to the terminal. We check if the right exists and it doesn't so that terminates that function call and we return to the next incomplete function call which is node 4...
      Hope this explanation helps

  • @charan2446
    @charan2446 2 роки тому

    Great man .......

  • @murshid-9188
    @murshid-9188 Рік тому

    How will we delete a node from it

  • @Harreesh555
    @Harreesh555 Рік тому

    Can binary search tree have duplicate values??

    • @luisthesup
      @luisthesup 5 місяців тому

      Yes, I think it would go to the right of its parent node

  • @zhspartan9993
    @zhspartan9993 Рік тому

    Thanks

  • @ajimnastiar2311
    @ajimnastiar2311 28 днів тому +1

    makasi bang

  • @trantuanngoc
    @trantuanngoc 11 місяців тому

    He codes so fast 😮

  • @FahmiEshaq
    @FahmiEshaq Рік тому

    Perfect

  • @terkperrichard9857
    @terkperrichard9857 Рік тому +1

    If I run your code is error

  • @alst4817
    @alst4817 3 місяці тому

    The non binary network diagram on the thumbnail was triggering me 😂

  • @gamerkeyx
    @gamerkeyx Рік тому

    You are a G

  • @youssefalaa2256
    @youssefalaa2256 Рік тому +3

    Nacho Varga

  • @krunalakbari9447
    @krunalakbari9447 2 роки тому

    waiting for the linklist

  • @expectolimited
    @expectolimited 2 місяці тому

    6:44 []