Тёмный

Red-black trees in 8 minutes - Deletions 

Michael Sambol
Подписаться 126 тыс.
Просмотров 99 тыс.
50% 1

Examples of deleting nodes from a red-black tree.
Code: github.com/msa...
Source: Introduction To Algorithms, Third Edition (CLRS) [www.amazon.com...]
LinkedIn: / michael-sambol

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

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 69   
@chupiggy
@chupiggy Год назад
3:49, is the 23 misplaced? (Should be the right child of 19?)
@MichaelSambol
@MichaelSambol Год назад
Argh, good catch @Johann Chu! I meant to flip 23 and 19 from the previous example. Thank you for pointing this out. The process is still the same, but the keys should be switched. 23 is the parent, and 19 is the left child.
@chupiggy
@chupiggy Год назад
@@MichaelSambol Got it. Thanks for making these clips man, they are really crystal clear. Thumbs up!
@MichaelSambol
@MichaelSambol Год назад
You're welcome! Thanks for the comment. I do my best and i have external review but sometimes I miss, so I appreciate it!
@synster693
@synster693 10 месяцев назад
i was yelling over chathpt and telling him he is making a misstake poor chatgpt lol
@terrasai2857
@terrasai2857 Год назад
I’ve waited 5 years just for your video 😂
@MichaelSambol
@MichaelSambol Год назад
😂🫱🏼‍🫲🏽
@ryanhill8180
@ryanhill8180 Год назад
Bro i just started this playlist today and the fact you took 5 years off 😂😂😂😂 hope you're all good i just find that hilarious. better late than never.
@MichaelSambol
@MichaelSambol Год назад
Pathetic, right?! I got lazy. But I'm back!
@aliozgunakyuzstudent7942
@aliozgunakyuzstudent7942 Год назад
I've been waiting for 5 years to pass the course thx for the video
@onurcanisler
@onurcanisler 7 месяцев назад
😂
@hlibdolinin4404
@hlibdolinin4404 2 года назад
Just watched the 4 previous video and at the same day 5th video is uploaded 👍
@kirilldolgiy248
@kirilldolgiy248 2 года назад
same
@MichaelSambol
@MichaelSambol 2 года назад
perfect timing! one more coming (hopefully tonight).
@hlibdolinin4404
@hlibdolinin4404 2 года назад
🇺🇦
@kskbekfoznwd
@kskbekfoznwd 2 года назад
@@hlibdolinin4404 Same for me. Доречі не очікував тут украхнців побачити
@ДмитроБережний-т8ч
@@kskbekfoznwd курсова робота не шкодує нікого)
@Jeshuakrc
@Jeshuakrc 4 месяца назад
Previous video: "Today you'll see examples of red-black tree insertion! 😃😁" This one: "Better late than never. Even if I am 5 years late 🧔 👴"
@MichaelSambol
@MichaelSambol 4 месяца назад
🤦🏻‍♂️
@MichaelSambol
@MichaelSambol 4 месяца назад
🤦🏻‍♂️
@lin2k4
@lin2k4 Год назад
Procrastination pays off, I can watch the whole red-black playlist all at once now :D
@davidporterrealestate
@davidporterrealestate 2 года назад
I've been waiting for this
@Лев-й7я
@Лев-й7я Год назад
Я ждал ето 20 секунд пока реклама шла
@ejsafara456
@ejsafara456 Год назад
thank you so much for continuing the red black tree series ^^ its much of help to me :D clear, concise and understandable!
@MichaelSambol
@MichaelSambol Год назад
you're welcome!
@LongTran-tr8sx
@LongTran-tr8sx Год назад
i rearly comment in any type of video but i must say you did a really good job, thanks for your work to help us understand more about programming
@amanasati5198
@amanasati5198 Месяц назад
I remember, I had watched the RB tree till insertion when I was at college and was just revising this topic. As the insertion example video ended, I thought it's the end. "But here we go again". Thanks 😂😂
@jian213
@jian213 5 месяцев назад
5 years late? you're just on time for me! thanks for the video
@MichaelSambol
@MichaelSambol 5 месяцев назад
Love it! Welcome.
@mohitpal1505
@mohitpal1505 Год назад
Why did you consider NiL to be red in the end???
@BigDoke
@BigDoke 2 года назад
Perfect timing man, I have an exam in 3 days :D
@yzerjakenavarroza
@yzerjakenavarroza 4 месяца назад
this is so funny T-T I'm shocked with your voice changing
@judepope6196
@judepope6196 2 месяца назад
I'm coming for the delete-mixup haha
@HavnisD2
@HavnisD2 Год назад
Since nil is a black node in the last example, is there not an equal number of black nodes across each path?
@waleedtariq2983
@waleedtariq2983 Год назад
Yes, It has to be
@udaykiran-zb2cd
@udaykiran-zb2cd Год назад
You are excellent man.. thanks for these short yet high-value clips... Red-black trees are now clear for me. By any chance you have similar clips for 2-3-4 trees?
@MichaelSambol
@MichaelSambol Год назад
Thank you! I haven't done 2-3-4 trees yet but they're on the list.
@metalalive2006
@metalalive2006 Год назад
Thanks for the explanation. For the transplant function, since you'd like to check whether the 2 variables `u.p.left` and `u` point to the same object, not the value in the object, would it be more appropriate to use `is` syntax than `==` ?
@AladdinPersson
@AladdinPersson 2 года назад
Bro your explanations are top notchh
@MichaelSambol
@MichaelSambol 2 года назад
thanks bro! yours too.
@silasreef5926
@silasreef5926 Год назад
4:36 Just wondering, why don't we consider if both children are NIL ? if node is black it breaks the tree balance.
@MichaelSambol
@MichaelSambol Год назад
If both children are nil, the first case is true. :) github.com/msambol/youtube/blob/master/trees/red_black_tree.py#L142
@silasreef5926
@silasreef5926 Год назад
​@@MichaelSambol Yeah i saw it, was wondering cause i had an issue with that, and didn't know if ive messed up in the implementation of the tree, or in the sutff around the tree. (I'm implementing a red black tree to recode std::map in c++ for a school project) And i had a recurrent segfaulft down the line in that particular case when both children are NIL : - by passing a NIL in transplant, prog crashes when calling the parent. Anyway if you are interested i've found a way to handle that on geeksforgeeks "fixDoubleBlack" Thx for the answer btw, i sub for that :)
@Enzoerb
@Enzoerb 3 месяца назад
thankfully I am watching this 7 years late
@MichaelSambol
@MichaelSambol 3 месяца назад
just in time
@saraghosalkar4322
@saraghosalkar4322 2 года назад
DSA God ! Thank you so much :)
@aliciachoi
@aliciachoi 5 месяцев назад
Hi Michael thank you for the efforts and coming back to complete it after 5 years👍👍I watched all of them and they are very friendly to beginner like me👍
@remonataf8960
@remonataf8960 11 месяцев назад
bro casually waited 5 years to continue his masterpiece thank god I started learning red black trees after he finished this playlist
@MichaelSambol
@MichaelSambol 11 месяцев назад
Just in time 🤪
@remonataf8960
@remonataf8960 11 месяцев назад
😂😂😂😂@@MichaelSambol
@ArisTheMage
@ArisTheMage 5 месяцев назад
Hi micheal, yes, better late then never, I was watching this series today, and this video will continue to help me pass my class lol
@amanbisht579
@amanbisht579 Год назад
dude how tf is this channel not discovered by people yet
@MichaelSambol
@MichaelSambol Год назад
slow and steady... thanks for watching!
@RockOfGreece
@RockOfGreece 9 месяцев назад
what about the case that both children are nill?
@MichaelSambol
@MichaelSambol 9 месяцев назад
this case? github.com/msambol/dsa/blob/master/trees/red_black_tree.py#L182
@astrixinthestars1047
@astrixinthestars1047 6 месяцев назад
right when we needed him most, he reappeared
@jeez123
@jeez123 5 месяцев назад
I'm so lucky that you released this now right when i need it
@kapt0xa_by
@kapt0xa_by 2 месяца назад
how can i call fixup for deleted node???
@MichaelSambol
@MichaelSambol 2 месяца назад
github.com/msambol/dsa/blob/master/trees/red_black_tree.py :)
@izydor3344
@izydor3344 Год назад
6:48 You call tansplant and the second argument is null. But this is not covered in by the method's code on 1:35
@smoulibabca
@smoulibabca 8 месяцев назад
It is not null, it is NIL node, which is still a node with a parent.
@devashishathawale4807
@devashishathawale4807 10 месяцев назад
The sequel we needed
@ksaweryhasnik
@ksaweryhasnik Год назад
I checked your code and there is a line which I don't quite understand. It's about line 155-156: if y.p == z: x.p = y. If I understand it correctly there is no point in setting x.p = y since y is already x's parent. Can you explain it to me? Thanks
@MichaelSambol
@MichaelSambol Год назад
It is, but you need to set the pointer :)
@ksaweryhasnik
@ksaweryhasnik Год назад
@@MichaelSambol oh okay, I'll read more about it, thank you for your answer :)
@animeboy9355
@animeboy9355 Год назад
damn bro literally returned after 5 year
@MichaelSambol
@MichaelSambol Год назад
Back!
@tauheedakbar3524
@tauheedakbar3524 Год назад
Nice work man thanks
@chhapriyt5686
@chhapriyt5686 10 месяцев назад
When l created red black tree why i delete node what the fuck 😂😂😂
Далее
Red-black trees in 6 minutes - Delete Fixes
5:49
Просмотров 41 тыс.
pumpkins #shorts
00:39
Просмотров 14 млн
8 patterns to solve 80% Leetcode problems
7:30
Просмотров 375 тыс.
Red-Black Trees
22:05
Просмотров 20 тыс.
God-Tier Developer Roadmap
16:42
Просмотров 7 млн
The hidden beauty of the A* algorithm
19:22
Просмотров 865 тыс.
Heaps in 6 minutes - Methods
5:56
Просмотров 75 тыс.
Big-O notation in 5 minutes
5:13
Просмотров 1,1 млн
pumpkins #shorts
00:39
Просмотров 14 млн