Data structures: Binary Search Tree

Поделиться
HTML-код
  • Опубликовано: 20 янв 2025

Комментарии • 387

  • @supastar25
    @supastar25 4 года назад +206

    I absolutely LOVE how you started off by showing the common operations and their time analysis for Arrays and Linked lists before introducing BST. Sometimes you just know these things but not exactly WHY the need for them in the first place. Thanks.

    • @Lyriks_
      @Lyriks_ 3 года назад +2

      totally agree with you

  • @leixun
    @leixun 4 года назад +83

    *My takeaways:*
    1. Computation complexity comparison of searching/inserting/removing elements in Array (sorted, unsorted), linked list and binary search tree (balanced) 0:00 - 9:28
    2. What is balanced binary search tree and why it is efficient for searching 9:30
    3. Unbalanced binary search tree 16:22
    3. Insert and remove elements in balanced binary search tree is also efficient 17:44

  • @ajaysabarish9645
    @ajaysabarish9645 7 лет назад +17

    yours is perhaps the only lectures series that doesn't confuse students with unnecessary things,it is really great,thank you very much

  • @ccossmin
    @ccossmin 2 года назад +11

    Honestly this was one of the best, if not *the* best algorithm exploration I've ever seen. Congratulations to the author(s)!

    • @mrspock7277
      @mrspock7277 2 года назад

      One of the authors died in a hit and run case, back in 2014. It’s really a great loss. The other one is working for google in Silicon Valley.

  • @temitopeoyeyemi899
    @temitopeoyeyemi899 6 лет назад +243

    if you have exam this morning skip and start at 9:53

    • @saitaruns
      @saitaruns 4 года назад +10

      And play the video in 2x

    • @akashlenka4068
      @akashlenka4068 4 года назад

      @@saitaruns 🌝😅

    • @tasty0rang3
      @tasty0rang3 3 года назад +5

      @Ammie Zolman wow! a shady comment posted minutes after, i’m gonna believe this :D

    • @piyushagarwal5830
      @piyushagarwal5830 3 года назад

      @@tasty0rang3 lol

    • @kirind7181
      @kirind7181 3 года назад +1

      thanks dude

  • @ArpanPathak
    @ArpanPathak 9 лет назад +146

    You are the best teacher in this planet .....

    • @zahirjacobs716
      @zahirjacobs716 7 лет назад +6

      He was. R.I.P.

    • @peachyspalace
      @peachyspalace 7 лет назад

      Hes dead? Didnt he upload a video 5 months ago?

    • @AhmedHadiPADI_scuba_instructor
      @AhmedHadiPADI_scuba_instructor 7 лет назад +1

      are you serious ?

    • @zahirjacobs716
      @zahirjacobs716 7 лет назад +2

      Ahmed Hadi unfortunately I am. Sometime in 2014 already. There is a Quora answer about this written by the cofounder of this channel. Google humblefool.

    • @sourabhsingh4058
      @sourabhsingh4058 5 лет назад +1

      @@zahirjacobs716 nop brother he is alive

  • @AteebAkmal-x5h
    @AteebAkmal-x5h 2 месяца назад

    After looking at many videos online of many different youtubers. This is the best one. The way he introduced arrays and linked list first and the issues with them and how can we fix your issues is exactly what everyone needs to know

  • @WolfKelley1
    @WolfKelley1 3 года назад +3

    Hands down the best and most clear cut example on binary search tree so far. Thank you.

  • @brianspain4252
    @brianspain4252 7 лет назад +17

    You sir are an incredible teacher. Your delivery and pace is so easy to understand. Thank you for the great content.

    • @karthikkumaresan1091
      @karthikkumaresan1091 Год назад

      He won't hear you. He passed away in an accident, a year after these lessons came out.🙁

  • @dineshbhonsle6524
    @dineshbhonsle6524 8 лет назад +2

    Very crisp and clear, it was 16 years since i graduated and never brushed up on this topic. Excellent !

  • @tutorialshub4232
    @tutorialshub4232 10 лет назад +5

    Dear brother, your lectures have indeed helped me a lot for my university studies.
    Thank you so much for putting up this selfless effort.
    May God reward you with goodness.

  • @megr
    @megr 2 года назад +3

    One of the best videos I've seen regarding data structures. Thanks for sharing the knowledge.

  • @UshaPonnada
    @UshaPonnada Год назад +2

    You are a great teacher and confident teacher with profound knowledge

  • @malkavian6275
    @malkavian6275 4 года назад +3

    One of the best explanations I've seen on any subject, I understand this perfectly now. Thank you!

  • @moiqubal
    @moiqubal 10 лет назад +40

    You give an excellent lecture. Please don't change a thing.

  • @ananyadixit1215
    @ananyadixit1215 5 лет назад +2

    I literally loved the way you turn things and make it go concrete in our head..! You are surely a life saviour 🙏

  • @evanl5299
    @evanl5299 7 лет назад +7

    Excellent explanation. I wish my university classes were this concise and well-explained.

  • @vishalsnsingh
    @vishalsnsingh 4 года назад +8

    I left my college lectures to study this video, wonderful and easy explain!

  • @RahulKumar-wk2jp
    @RahulKumar-wk2jp 6 лет назад +3

    You all lectures are very simple and understandable...thanks a lot..keep working like that..

  • @tr2494
    @tr2494 6 лет назад +2

    your videos are really helpful , moreover they convey all the info with so much of ease of understanding , and so efficiently , love your work , its great .and thanks from my side and as well as from the whole freshers in my college cause about more than 90% watch these for sure .

  • @GintoPlays
    @GintoPlays 4 года назад +5

    This is a really concise and clear explanation of a BST. Thank you!

  • @___vijay___
    @___vijay___ 4 года назад +3

    You have done something very good.
    We are getting good knowledge because of you.
    Thank you.

  • @joeybing3476
    @joeybing3476 9 лет назад +7

    simply the best. I'd say your method of explanation is great.

  • @sudhirsharma2902
    @sudhirsharma2902 3 года назад +2

    Man! the teaching level is just amazing. Respect for the knowledge and research behind this level of content-creation. Thanks with all my heart ❤️.

    • @karthikkumaresan1091
      @karthikkumaresan1091 Год назад

      He was a pioneer of DS teaching in India but passed away at age 30. ☹

  • @deepakbhatt799
    @deepakbhatt799 4 года назад +2

    Great lecture sir, these 20 mins are worthy. Thank you sir.

  • @createprince2093
    @createprince2093 8 лет назад +4

    This is super great. Your explanations are concise and understandable and the graphics really help. Thanks for making these :) I will definitely be watching more of these data structure lessons!

  • @liliayu
    @liliayu 9 лет назад +17

    It's very helpful, Thank you for your explanation

  • @Pimpinpark777
    @Pimpinpark777 7 лет назад +189

    Video starts at 9:38. You're welcome

  • @anubhavsinghal9218
    @anubhavsinghal9218 6 лет назад +1

    I just checked out your videos on BST and I must say, Thank you very much.
    That was amazing....I mean now I know the basic functionality of BST.

  • @lpcruz5661
    @lpcruz5661 9 лет назад +1

    Do some more computer science stuff. You are articulate and easy to understand. I like it when you repeat to re-enforce the concepts. Well done.

  • @aniruddhashahapurkar9244
    @aniruddhashahapurkar9244 4 года назад

    Best explanation I have ever seen for a data structures' concept!

  • @gloriakinya3986
    @gloriakinya3986 3 года назад

    Well,, been taught this in an online class and grasped nothing but here, still online am getting it all🤗🤗Thankyou

  • @aaradhanah5059
    @aaradhanah5059 5 лет назад +6

    I am emotional after hearing about this guy's story he is Harsha Suryanarayanan from IIIT-A, he was the highest rated geek in Topcoder in India he mentored his juniors but unfortunately he died while crossing a road, I am happy that he is still mentoring lot of us. #TributeToHarsha

    • @r.m.harish5529
      @r.m.harish5529 4 года назад

      Don't spread false information that was his friend. He is still alive.

    • @aaradhanah5059
      @aaradhanah5059 4 года назад

      @@r.m.harish5529 why do I want to spread false information, am I getting any awards for it, before arguing check news yourstory.com/2014/06/techie-tuesdays-humblefool?

    • @r.m.harish5529
      @r.m.harish5529 4 года назад

      @@aaradhanah5059 bro the person who actively controlled this channel was the co founder animesh. He is alive and well. Harsha does not make the videos, animesh does.

    • @aaradhanah5059
      @aaradhanah5059 4 года назад

      @@r.m.harish5529 This channel is not active, it is a teamwork between harsha and animesh, If he is alive this channel might me active, also I wish animesh to teach us, I just made a comment to appreciate harsha's dedication reply before researching about it

    • @r.m.harish5529
      @r.m.harish5529 4 года назад +1

      @@aaradhanah5059 atleast now you accept that it's a teamwork. I only corrected you earlier because you made it seem like it was an effort only by Harsha. Other people may not know about animesh, who made these videos. I hope you understand and take it in the right sense sorry if I hurt you by saying u spread false info

  • @colorpanda8409
    @colorpanda8409 8 лет назад +15

    Simple and clear, helps a lot, thank you very much.

    • @fsyk1306
      @fsyk1306 2 года назад

      Hey man it's been 5 years. How far have you come?

  • @nihaanali5923
    @nihaanali5923 8 лет назад +2

    Better explanation than my university lecturer. Thank you!

  • @MohakNarang07
    @MohakNarang07 7 лет назад +2

    As much as i've read so far, a BST cannot contain duplicate values. But at 11:25, you said that the left child can contain a value 'less than or equal to' the value of the parent node. Can someone please clear this confusion. Thanks!

  • @anoniem012
    @anoniem012 4 года назад +6

    Very good, thank you! For showing the necessity of learning this first.

  • @capolo2
    @capolo2 11 лет назад +13

    Just wanted to clarify, the tree presented at 17:28 is not meant to be a binary search tree, correct? If so, shouldn't 17 appear as the right child of 15?

    • @mycodeschool
      @mycodeschool  11 лет назад +21

      capolo2 That's an error :( .. Thanks for noticing. I am putting an annotation marking it.

    • @rajnandwani7777
      @rajnandwani7777 8 лет назад

      I think its still a binary search tree but not balanced. Correct me if i m wrong.

    • @MathAssistant
      @MathAssistant 7 лет назад +1

      +raj nandwani Not a binary search tree if unfixed. Binary search tree is only that if the left is smaller than the root and the right is greater than the root.

    • @RajeshRaj-jj9oc
      @RajeshRaj-jj9oc 7 лет назад

      raj nandwani
      Hi
      Mam

  • @akashvarde
    @akashvarde 7 лет назад +1

    I PAUSED THE VEDIO TO GIVE A LIKE AND SUB , NICE EXPLANATION ! KEEP IT UP

  • @adarshverma3372
    @adarshverma3372 4 года назад +2

    when you talk about time complexity ,why to use trees i stooped the video and liked it and do this comment for thanking you for this level of explanation

    • @lupsik1
      @lupsik1 4 года назад

      Its a basic thing you have to know if youre studying for an algorithms/data-structures exam, so its not really surprising he covered it.
      Like almost any operation you learn in CS, one of the first questions are always "What is the avg. time complexity ? what is the optimistic/pessimistic time complexity ? What is the space complexity ?"
      And those are really important questions, its awesome you recognised the significance of that, means you have proper intuition : )

  • @qingen7005
    @qingen7005 6 лет назад

    Hi I would like to clarify regarding binary search insert.
    At 7:25, you mentioned that a binary search is required to find the first integer greater than 5. My question is how do we know which item specifically to look for, and in the event where we found an integer (let's say 9), how do we know if we should stop or continue searching for another integer (that is smaller than 9 but still bigger than 5).
    I'm just a bit confused here because from my understanding binary search looks specifically for an integer, so I'm not sure how we can search for the next bigger integer after 5.
    Thanks

  • @photinoman
    @photinoman 8 лет назад +1

    Thank you, I just need popcorn to watch the rest of your videos!

  • @ainbrisk545
    @ainbrisk545 Год назад

    thank you so much! I appreciate you starting with the problem, made the rest of the video easier to understand :)

  • @nikhilchoudhary2955
    @nikhilchoudhary2955 7 лет назад +1

    Best tutorial for data structures ever had Subscribed:)

  • @akhilkola8124
    @akhilkola8124 9 лет назад +6

    Excellent explanation and its really good videos

  • @b.f.skinner4383
    @b.f.skinner4383 3 года назад +1

    You're an amazing teacher, thank you

  • @prashant3735
    @prashant3735 5 лет назад

    I like your way of teaching....My teachers also study your lectures before coming to class :D

  • @deepakjain-dr7ds
    @deepakjain-dr7ds 9 лет назад +1

    please upload more data structures videos ! its really helpful !

  • @liemh9290
    @liemh9290 5 лет назад +2

    There need to be a compiled list of RUclips courses. best ones like this make the list. THERE are too many.

  • @kellybmackenzie
    @kellybmackenzie 2 года назад

    Thank you so much, this is so incredibly helpful! I really appreciate it!!

  • @murtuzabohari7122
    @murtuzabohari7122 9 лет назад +1

    @mycodeschool really good lec. Were really helpful for viva. Kudos to you!!!

  • @trinhdangdang9766
    @trinhdangdang9766 Год назад

    at 15:30, talking about unbalanced tree, should it be the depth and not the height. "A tree is balanced when, for all nodes the difference between heights of left and right subtree is not greater than 1"?? should it be depth instead of heights?

  • @zonenetplus
    @zonenetplus 11 лет назад +2

    Great !! very easy to follow and understand. Thank you very much !

  • @kranthitech
    @kranthitech 11 лет назад +8

    Thanks for making this.. cleared some concepts :)

  • @KevinBateman
    @KevinBateman 10 лет назад +9

    There appears to be a mistake @ 17:30 , that is not a binary search tree at all, the 17 is in the left child of 15, it should be in the right child I believe.

    • @brooklyna007
      @brooklyna007 10 лет назад +2

      Just so others know it looks like he fixed the video accordingly. Nice catch Kevin.

    • @jayant9151
      @jayant9151 6 лет назад +1

      @@brooklyna007 nope it's incorrect

    • @mythiliinbalagan738
      @mythiliinbalagan738 5 лет назад

      I think no, if you closely take a look 17 is in the right child of 15 and left child of 20. I think so.

  • @pramaynikhade99
    @pramaynikhade99 6 лет назад

    There's so much of clarity....you really eel so enlightened :)

  • @Rajkumar-oo6bv
    @Rajkumar-oo6bv 4 года назад

    Best explanations of data structure. Loved it!!

  • @tyrisnolam
    @tyrisnolam 9 лет назад

    @18:33 wouldn't it worth to swap number 17 and number 19 (and after the swap, put 17 on the left, of course) after we found where to insert it?

  • @hofsepzakharyan5838
    @hofsepzakharyan5838 9 лет назад +35

    you explain it wonderfully.. subscribed ;)

    • @SonuSonu-tk5pk
      @SonuSonu-tk5pk 8 лет назад +1

      why dont u go to ur country and study

    • @wisharya
      @wisharya 6 лет назад +2

      what a reply man

  • @nullbyte2215
    @nullbyte2215 5 лет назад +6

    Great explanation. Could you please enable the fan funding option so we can donate to this channel. We need more content like this. We know humblefool, not with us. We need more from this channel.

  • @avaneeshyadav124
    @avaneeshyadav124 8 лет назад +1

    Nicely Explained in a very excellent way...Thanks Sir

  • @MrIglaq
    @MrIglaq 8 лет назад +1

    At 7.22 min u mentioned about inserting element into sorted array by performing 2 steps: 1)- find the position in array (use Binary Search -O(logn)) and 2)- shift all records (O(n)). How overall complexity time is O(n), since we have the sum of O(n)+O(logn)?

  • @mashable8759
    @mashable8759 8 лет назад +2

    BEST EXPLANATION EVER!

  • @coolguy9616
    @coolguy9616 2 года назад +1

    Hey man I know you'll never see this but I appreciate you

  • @vipin_mishra19
    @vipin_mishra19 5 лет назад

    U r awesome....I don't know how to thank to you...but literally ur explanation is too good

  • @ashwinikumar3721
    @ashwinikumar3721 5 лет назад

    Thanks...You really are a great Teacher

  • @sanatit6429
    @sanatit6429 7 лет назад

    Your English is very good.grate job.

  • @kesharwani.prashant
    @kesharwani.prashant 3 года назад

    Thank you, you have great teaching skills

  • @gakateke5036
    @gakateke5036 5 лет назад +8

    rest in peace. and thank you very very much

  • @AhmedKhaledCH3
    @AhmedKhaledCH3 9 лет назад +4

    We can make a tail pointer which points to the end node of the linked list and add the newly created node to the end of the list with traversing from the head or the beginning and it will cost O(1).

    • @adityaravishankar8344
      @adityaravishankar8344 9 лет назад

      +Ahmed Kh'aled
      You need to traverse as you need to know where to insert the element
      For eg., if LL: 1;2;5;7;8;9
      and you want to insert 6, we cannot just make a pointer and insert at the rear end. We have to traverse from left to right
      LL: 6;1;2;5;7;8;9 [wrong]
      LL: 1;6;2;5;7;8;9 [wrong]
      LL: 1;2;6;5;7;8;9 [wrong]
      LL: 1;2;5;6;7;8;9 [correct]

    • @AhmedKhaledCH3
      @AhmedKhaledCH3 9 лет назад

      I must had said without back then.
      When I create a new node it updates a pointer called "tail" for instance.
      So whenever I want to add a node to the end of list I just get the address from "tail" and point it the one I want to create and which will be the new "tail", got it?

    • @bravheart95
      @bravheart95 9 лет назад

      و انا هيك بعمل .. اسهل و اسرع 👍

    • @stephan24297
      @stephan24297 6 лет назад +1

      I'm a bit late to the argument, but I agree with you. If you know the iterator already, then it is O(1). Else, you will have to find the iterator in which case it would be O(n).

    • @stephan24297
      @stephan24297 6 лет назад

      This is also adding on to the argument. It is from cplusplus.com "Unlike other standard sequence containers, list and forward_list objects are specifically designed to be efficient inserting and removing elements in any position, even in the middle of the sequence."

  • @TheLionheartCenter
    @TheLionheartCenter 5 лет назад +1

    You are an amazing teacher thank you

  • @mohitsaraswat8504
    @mohitsaraswat8504 7 лет назад

    Great bro Helped a lot for my exams

  • @ghostonerider6354
    @ghostonerider6354 10 лет назад +2

    Excellent lecture, thanks for posting!

  • @raral0934
    @raral0934 7 лет назад

    excellent explanation and example, will follow for more!

  • @mizeravel
    @mizeravel Год назад

    Thats an amazing lecture, thank you for the content.

  • @AGentlemansGaming
    @AGentlemansGaming 3 года назад +1

    You just explained in 19min what my professor took 3 hours and 45 slides to do.

  • @anirudhpandey2197
    @anirudhpandey2197 5 лет назад

    Osm .. Just one problems sometimes ur subtitle cover the white board 13:49

  • @talhaashraf6459
    @talhaashraf6459 5 лет назад

    At 12:00, isn't it a binary search tree? Because value in leaf node 16 is greater than 8

  • @TheGrimReaper0101
    @TheGrimReaper0101 11 лет назад

    just loved it , very nice video.
    i hope the implementation part comes soon .

  • @ruchitakadu5396
    @ruchitakadu5396 7 лет назад

    Very helpful...thanku so much sir...great explanation😘

  • @dukememo8524
    @dukememo8524 6 лет назад

    Very good video, very calming voice gj buddy

  • @lorimemontanes8950
    @lorimemontanes8950 3 года назад

    Hi. I am one of your subscriber, been following you for a couple of months. Can i possibly use this as a reference in our class, seems like you do have a very clear way of explaining. Thankyouuu.

    • @BROOKnim
      @BROOKnim 3 года назад

      yea you could keep his legacy alive .

  • @timalbathiya
    @timalbathiya 4 года назад

    AMAZING explanation. Thanks

  • @chupiggy
    @chupiggy 10 лет назад +1

    Thank you very much for this. This is excellent!

  • @yashchauhan2234
    @yashchauhan2234 6 лет назад

    Grate communication skill .all videos explain clearly thank you!!!!!!

  • @rodgersbyarugaba3904
    @rodgersbyarugaba3904 8 лет назад +1

    Better explanation than my university lecturer could manage.

  • @nabeelsyed8123
    @nabeelsyed8123 5 лет назад

    Brother kaafi badiya sanjaya hai aapne

  • @thanhdong8869
    @thanhdong8869 5 лет назад +1

    Thank you for the incredibly useful videos. Currently I also intend to share their knowledge, I'm disturbed that you did not know the building of images in a video using algorithms tool ?. Looking forward to hearing from you guys soon, thanks

    • @BROOKnim
      @BROOKnim 3 года назад

      sorry, they don't do videos anymore

  • @architmittal8659
    @architmittal8659 6 лет назад

    please provide the video for learning hashtables, maps, heaps plzzzz......you are the best!!!

  • @linustorvalds5190
    @linustorvalds5190 7 лет назад

    Your videos are great, thank you so much

  • @Stay.Strong.Keep.Moving
    @Stay.Strong.Keep.Moving 3 года назад +2

    At 2:17 - How does array insertion have worst case complexity of O(1)? You showed an example of insertion at the end. What if element is to be inserted in between the array or at the start? then all the other elements need to be shifted to right. This should make the worst case complexity as O(n)

  • @sebastianback
    @sebastianback 3 года назад

    Great explanation! Thank you!

  • @irfan0066
    @irfan0066 10 лет назад

    way to speaking is superb dude...

  • @LAnonHubbard
    @LAnonHubbard 9 лет назад

    Amazingly clear, thanks.

  • @RaviShankar-gm9of
    @RaviShankar-gm9of 5 лет назад

    excellent explanation it's awesome...

  • @dollarakshay
    @dollarakshay 10 лет назад +6

    I know this is probably something simple, but it shows you how beautiful Programming can be :)
    Do watch it.It might inspire you to come up with something cool of your own : Java : Binary Tree Animation
    Just thought ill post it here since it is sort of related.

  • @madheehasheik3039
    @madheehasheik3039 5 лет назад

    Nice explanation. .👍👍

  • @Srimudit
    @Srimudit 3 года назад

    RIP the best DSA teacher internet had ever seen.

  • @sabyasachidas6115
    @sabyasachidas6115 3 года назад

    Petition to restart @mycodeschool !!!

  • @links212
    @links212 10 лет назад

    Why is the linked list connected to ground (3:56)? Is that deliberate?

    • @utkarshverma350
      @utkarshverma350 10 лет назад

      It's optional to connect it to the ground....just for understanding....it is as good as NULL...