Тёмный

Binary Search Trees (BSTs) - Insert and Remove Explained 

colleen lewis
Подписаться 4,5 тыс.
Просмотров 303 тыс.
50% 1

Опубликовано:

 

8 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 236   
@fuckkg
@fuckkg 9 лет назад
this is probably the best tutorial on RU-vid
@Daniellagnaux
@Daniellagnaux Месяц назад
Of all videos on RU-vid, you posted the best tutorial on BST
@ColleenMLewis
@ColleenMLewis Месяц назад
Thank you! I'm glad it was helpful to you!
@ank2871
@ank2871 Год назад
thank you so much for that simple explanation!. i was so confused about this all the time
@ColleenMLewis
@ColleenMLewis Год назад
I'm glad it is helpful to you!
@Simoky99
@Simoky99 5 лет назад
video from 2013 helping me 6 years later.... thanks!
@ColleenMLewis
@ColleenMLewis 5 лет назад
Glad to hear it! :-) - Colleen
@aryangoel4320
@aryangoel4320 7 месяцев назад
best explaination , simple language and covering all the cases . THANKS A LOT
@ColleenMLewis
@ColleenMLewis 6 месяцев назад
Glad it was helpful! Thanks for the note!
@williamz8330
@williamz8330 4 года назад
This is the best explanation of BST methods I've seen
@ColleenMLewis
@ColleenMLewis 4 года назад
Thanks! :-)
@abhilashpatel3036
@abhilashpatel3036 4 года назад
Small and concise. To the point. Loved it. Thanks alot.
@vishnuvalleru
@vishnuvalleru 10 лет назад
This is the best explanation I ever came across. short and up to the point. Thank you.
@ColleenMLewis
@ColleenMLewis 10 лет назад
Thanks Vishnu!
@conradmbugua9098
@conradmbugua9098 Год назад
concise and clear, such a beautiful presentation ma'am
@mryup6100
@mryup6100 4 года назад
This clears up everything I only 6 minutes!
@ColleenMLewis
@ColleenMLewis 4 года назад
I'm glad the video is helpful to you! - Colleen
@VipinKumar-uy2sw
@VipinKumar-uy2sw 8 лет назад
Damn ! Tree operations are so easy ! This 6 min video taught me what I couldn't learn in 3 hour class. U r amazing ...thx ...muaahhh :)
@JohnSmith-zg2id
@JohnSmith-zg2id 7 лет назад
What my professor couldn't make clear lecture after lecture after lecture, nor could my TA, you did in 6 minutes. Thank you so much for sharing this.
@TheXHypex
@TheXHypex 9 лет назад
Learning for my exams at the moment so thank you very much for this video!
@ColleenMLewis
@ColleenMLewis 9 лет назад
TheXHypex Thanks! I hope the exams went well!
@nafishy
@nafishy Год назад
Awesome! clear and concise explaination! İ came here from the Odin project
@ColleenMLewis
@ColleenMLewis Год назад
Glad it was helpful!
@mrodriguezglobe
@mrodriguezglobe 4 года назад
Thank you so much for this video!
@critangotv8119
@critangotv8119 Год назад
This was one of the best explanations I have seen yet, so simple, so concise. Thank you, Colleen
@Karim-nq1be
@Karim-nq1be Год назад
First I thought this explanation was going bad because the quality of the picture you put is low. But that's actually one of best explanations I've seen, thank you.
@jayjoshi3853
@jayjoshi3853 8 лет назад
I have checked many insertion and deletion videos, but yours is best one. Sweet, short ,simple and effective though. Thanks.
@MrNish27
@MrNish27 8 лет назад
amazing explanation. I used to always get stuck in the removal of a node, but now everything is clear.
@geeksclub3455
@geeksclub3455 9 лет назад
The best video ever.. Made the deletion look so much easier.. I wish you were my teacher
@xdae
@xdae 7 лет назад
Great! This was a really clear review. Except for case 3 you only talked about finding the min of the right subtree. One can also replace the target node with the max of the left subtree. Either method works in keeping the tree in order.
@ColleenMLewis
@ColleenMLewis 7 лет назад
That's correct. And we only need to replace it with one of those - and we should be consistent about which one we choose.
@joshuaronisjr
@joshuaronisjr 6 лет назад
👍🏿
@nipunasudha
@nipunasudha 5 лет назад
nice
@shahzamanniazai3832
@shahzamanniazai3832 8 лет назад
Excellent video ... Best way to learn is to sit patiently, watch and practice the mind along with the video (pausing video at various points to do self analysis)..... Reply ·
@dulanjanaliyanagama3823
@dulanjanaliyanagama3823 7 лет назад
The way you explained is brilliant!!! It's marvellous that you manage the whole thing within 6 minutes. Job well done!!!
@mohamadallan8548
@mohamadallan8548 5 лет назад
I can't believe I understand this now better than after a 2 hours class at the uni
@ColleenMLewis
@ColleenMLewis 5 лет назад
Glad to hear it was helpful!
@Ginzo111
@Ginzo111 6 месяцев назад
Amazing explanation, thank you
@towhidskynet
@towhidskynet 8 лет назад
Finally. English. thank you so much!!!
@Mmnc-bv3rk
@Mmnc-bv3rk Год назад
best explination i could find on the subject, thank you a lot
@PRIYANKA1998
@PRIYANKA1998 9 лет назад
i never thought it was this easy
@ericstevens653
@ericstevens653 5 лет назад
Using your video to prepare for an interview. Thanks for your help.
@khumkhatri5810
@khumkhatri5810 8 лет назад
Thank you so much your explanation is very good and easy to understand....hope you will be uploading such types of explanation in next topics
@mdilligaf
@mdilligaf 7 лет назад
Useful and clear, thanks. BSTs seem like a very useful invention.
@bombambum7955
@bombambum7955 9 лет назад
short and effective !!
@ColleenMLewis
@ColleenMLewis 9 лет назад
BomBamBum Thanks! And thanks for the ascii art below! :-)
@alexitosrv
@alexitosrv 8 лет назад
Very succinct and to the point. Good video! I loved also the style for representing the different cases so I can rebuild the algorithm my own head without need to memorize anything else.
@LukasJosai
@LukasJosai 5 лет назад
It took you 6minutes to explain something our teacher failed to do in 2 hours, thx
@abrahamdampson5879
@abrahamdampson5879 4 года назад
Algo and Data structures exams in 2 hours. Thanks for saving my life.
@ColleenMLewis
@ColleenMLewis 4 года назад
Thanks for the note - I'm happy it was helpful! - Colleen
@rinormehmeti8515
@rinormehmeti8515 7 лет назад
This video might be old but it was so useful and effective! Thanks a lot! Wish you all the best!
@AmbiguousAbhi
@AmbiguousAbhi 8 лет назад
i have my exam in 1 hour, and was getting confused in delete and insert. U made it look very easy. thanks a lot . #awesome
@ColleenMLewis
@ColleenMLewis 8 лет назад
+Abhijeet Joshi Good luck! :) Thanks for the comment!
@mmsky6316
@mmsky6316 7 лет назад
this helps me. I understand BSTs really well, but removing nodes continues to stump me. thank you for the clarification.
@squirrelbrains2197
@squirrelbrains2197 7 лет назад
thanks, that was a simple, but very clear explanation.
@shingookang6396
@shingookang6396 4 года назад
Best explaination
@ratnrajsingh6598
@ratnrajsingh6598 5 лет назад
your video is best than other countries RU-vidr video
@FA-ff4dz
@FA-ff4dz 5 лет назад
Thank you so much for making such an awesome video that explains the whole idea clearly. It helps me a lot
@ColleenMLewis
@ColleenMLewis 5 лет назад
I'm glad it was helpful! Thanks for the comment!
@Mahdi-hq4te
@Mahdi-hq4te 7 лет назад
Very helpful, thank you! I also liked the way you explained it.
@bilallaaroussi7110
@bilallaaroussi7110 3 года назад
Thank you!
@andrewrayanit
@andrewrayanit Год назад
Well explained. Thanks a lot.
@sonic2kk
@sonic2kk 7 лет назад
Extremely useful! Thanks for uploading.
@ColleenMLewis
@ColleenMLewis 7 лет назад
Thanks! :-) I'm glad it is helpful!
@badis23
@badis23 9 лет назад
Very clear tutoriial and nice voice too thanks sweety!
@erickvazquez2070
@erickvazquez2070 9 лет назад
Thank you so much! This is very clear and easy to follow!
@durgeshbg
@durgeshbg 2 месяца назад
its 2024 and this's still a great explanation
@ColleenMLewis
@ColleenMLewis 2 месяца назад
Thanks so much! :)
@sreekeshv12
@sreekeshv12 7 лет назад
Awesome thanks understood it within a time span of 6 mins :D
@SuperJAIMISH
@SuperJAIMISH 8 лет назад
Pretty concise and clear. Thanks!
@mrodriguezglobe
@mrodriguezglobe 4 года назад
Binary Search Tree Delete: 1:45
@jayrmadrio8142
@jayrmadrio8142 3 года назад
THANKYOU SO MUCH😭💓
@ColleenMLewis
@ColleenMLewis 3 года назад
Thanks for the comment! I'm glad it was helpful! :-)
@samyouanes7194
@samyouanes7194 2 года назад
What an awesome explanation! Thank you a lot :)
@kedarnadkarny4718
@kedarnadkarny4718 7 лет назад
Clearly explained. Thanks!
@halluciongen3000
@halluciongen3000 10 лет назад
This was really good, thank you!
@mitul209
@mitul209 5 лет назад
This video is really helpful and effective to learn about trees.I am from Bangladesh.Thanks Colleen Lewis ♥
@ColleenMLewis
@ColleenMLewis 5 лет назад
Thanks for the note :-)
@tsejrome
@tsejrome 5 лет назад
professor dude from my uni took 2 hrs to explain this 6 mins and this female wibba explains a whole lot better, thanks a lot madam.
@mikek.2703
@mikek.2703 7 лет назад
Thanks a lot for your help.
@gouki1001
@gouki1001 6 лет назад
Awesome simple video!
@TheVirtualLab
@TheVirtualLab 7 лет назад
Amazing explanation thank you!
@danielgrindrod9526
@danielgrindrod9526 8 лет назад
Brilliant video, thanks!
@dingleberry42
@dingleberry42 2 года назад
thank you so freaking much!
@ColleenMLewis
@ColleenMLewis 2 года назад
I'm glad it is helpful to you!
@HassaanALal
@HassaanALal 6 лет назад
what a badass teacher
@roykamau7001
@roykamau7001 7 лет назад
Thanks Colleen.. So so much
@josefinkarlsson3712
@josefinkarlsson3712 6 лет назад
Amazing video! Thank you
@ColleenMLewis
@ColleenMLewis 6 лет назад
Thanks :-)
@xinhuaxu
@xinhuaxu 6 лет назад
Thanks! Good video for learning!
@ThiagoBenazziMaia
@ThiagoBenazziMaia 8 лет назад
Fastest and best video -)
@Anooshaism
@Anooshaism 7 лет назад
But what happens to nodes labeled 34 and 36 when we remove their father( when we replaced 30 by 32) Now 34 and 36 should be placed on the left subtree of 40 and not on its right, how to deal with it algorithmically?
@ColleenMLewis
@ColleenMLewis 7 лет назад
When we replaced 30 with 32 we had to have deleted 32 so it is only in the tree once! To see what happens to 34 and 36 in that case, you can watch the video at 2 minutes and 50 seconds (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-wcIRPqTR3Kc.htmlm50s) where I had shown 32 being removed. Node 34 would be the new left child of node 40 (and node 40 would be the parent of node 34). Does that make sense?
@Anooshaism
@Anooshaism 7 лет назад
Yeah! Now I see it clearly! Thanks
@AlivHasan
@AlivHasan 9 лет назад
awesome..it helped a lot...lucid explanation
@TheRightGayGuy
@TheRightGayGuy 6 лет назад
This is some good stuff right here
@hopahop8071
@hopahop8071 4 года назад
Thank you soooooo muuuuuuch.
@ColleenMLewis
@ColleenMLewis 4 года назад
I'm glad this was helpful for you!
@hopahop8071
@hopahop8071 4 года назад
colleen lewis you have no idea. I passed my course because of your video. I cant even thank you enough.
@deveren
@deveren 5 месяцев назад
Greetings from odin!
@MontachirHossen
@MontachirHossen 5 лет назад
Thank you very much.
@muhammadraheel7393
@muhammadraheel7393 6 лет назад
i just love this
@ColleenMLewis
@ColleenMLewis 6 лет назад
Thanks! :-)
@noakemp7403
@noakemp7403 4 года назад
if I implement the remove method recursively, how can I remove a leaf ? Since by the time the recursion gets to the leaf, we lose access to the parent node
@abdallhghanem708
@abdallhghanem708 8 лет назад
Very Very Very effective thank you so much
@nipunasudha
@nipunasudha 5 лет назад
awesome explanation
@ColleenMLewis
@ColleenMLewis 5 лет назад
Thanks! :-)
@randyisme
@randyisme 8 лет назад
Thanks for the video!
@hanna319
@hanna319 4 года назад
Thank you!! You're amazing:)
@ColleenMLewis
@ColleenMLewis 4 года назад
Thanks for the note Hanna!
@joshsmit779
@joshsmit779 6 лет назад
Super good explanation
@AgentSubZero4
@AgentSubZero4 8 лет назад
thanks.. the best.. helped me alot..
@tanmoyt9391
@tanmoyt9391 8 лет назад
Thanks...this was very helpful
@AzatDzhanybekov
@AzatDzhanybekov 8 лет назад
Good Explanation! Thanx!
@vigneshvickey6699
@vigneshvickey6699 6 лет назад
short and accurate thanks alot
@DavidKhudaverdyan
@DavidKhudaverdyan 9 лет назад
Thank you for your video.
@DyslexicAnaboko
@DyslexicAnaboko 6 лет назад
This helped a lot thank you. I did something wholly different than this.
@HemanthKumar-sq7mq
@HemanthKumar-sq7mq 10 лет назад
thanks a lot
@praneethaluru2601
@praneethaluru2601 7 лет назад
thank you very much mam ...
@twinkly666
@twinkly666 8 лет назад
very clear. thanks a lot
@APC9906
@APC9906 6 лет назад
awesome video !
@ColleenMLewis
@ColleenMLewis 6 лет назад
thanks!
@mohammadusman3828
@mohammadusman3828 8 лет назад
ma'am you are just perfect :*
@saddamhossain2171
@saddamhossain2171 8 лет назад
Nicely explained!!!.... subscribed... :)
@ericknicolasnunesdahora4860
@ericknicolasnunesdahora4860 7 лет назад
Thank you professor! You helped me a lot! \o/
@TheThunderSpirit
@TheThunderSpirit 7 лет назад
what happens after deleting 32? what happens to 34 and 36?
@ColleenMLewis
@ColleenMLewis 7 лет назад
If we start with the tree at the very beginning of the video and delete 32, then we're deleting a node that has only one child. That's a simpler case (than if it had two children) and we can just make 40's left child be 34, which effectively removes 32. We just keep the same connection between 34 and 36, because in general we try to avoid restructuring binary search trees. Does that help?
@TheThunderSpirit
@TheThunderSpirit 7 лет назад
colleen lewis yes. so while deleting 30 why do u choose to swap 32 in place of 30? we can choose 20. that can work too? while deleting 70 we can replace by 65. which is next smaller that too maintain tree property.? does it always have to be next bigger element?
@ColleenMLewis
@ColleenMLewis 7 лет назад
That's just a convention for what you do when you delete a node with two children. I have chosen to use the next biggest rather than the next smallest, but either would work just fine. Does that make sense?
@TheThunderSpirit
@TheThunderSpirit 7 лет назад
colleen lewis yes. now the main question is how to decide which one choose to swap so that least cost is inccured. does it also work for equal keys?
@ColleenMLewis
@ColleenMLewis 7 лет назад
Two answers: Usually we'd just implement either the next biggest or the next smallest. Not both. We never have duplicate keys in our BST - so that never comes up. If we try to add a key that is already in the BST, we would just replace the old value associated with that key.
@VHCreator
@VHCreator 5 лет назад
Holy shit that was perfectly explained. Thank you.
@ColleenMLewis
@ColleenMLewis 5 лет назад
Thank you! :-)
@dillonhall3539
@dillonhall3539 9 лет назад
Thanks!
@GiuseppeMiragliotta95
@GiuseppeMiragliotta95 9 лет назад
thank you from italy :)
@LTM4620
@LTM4620 8 лет назад
Nice explanation :) like it ..
@ramialarabi2444
@ramialarabi2444 6 лет назад
so when I replace 30 with 32. do 34 and 36 stay as children of 40? or they follow 32 and 40 becomes a child of 36?
@orionthekat
@orionthekat 5 лет назад
I think it's easier if they follow 32. You can add an extra method to transplant the whole subtree, and 40 becomes the child of 36.
Далее
10.1 AVL Tree - Insertion and Rotations
43:08
Просмотров 1,2 млн
гендер пати🩷🩵
00:21
Просмотров 58 тыс.
Hash Tables and Hash Functions
13:56
Просмотров 1,6 млн
Delete a node from Binary Search Tree
18:27
Просмотров 1,1 млн
Binary Search Tree Removal
14:10
Просмотров 44 тыс.
Learn Binary search trees in 20 minutes 🔍
20:25
Просмотров 158 тыс.
2-3 Tree Insertion
8:00
Просмотров 320 тыс.
гендер пати🩷🩵
00:21
Просмотров 58 тыс.