Red-black trees in 8 minutes - Deletions

  Рет қаралды 103,664

Michael Sambol

Michael Sambol

Күн бұрын

Пікірлер: 69
@chupiggy
@chupiggy 2 жыл бұрын
3:49, is the 23 misplaced? (Should be the right child of 19?)
@MichaelSambol
@MichaelSambol 2 жыл бұрын
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 2 жыл бұрын
@@MichaelSambol Got it. Thanks for making these clips man, they are really crystal clear. Thumbs up!
@MichaelSambol
@MichaelSambol 2 жыл бұрын
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 11 ай бұрын
i was yelling over chathpt and telling him he is making a misstake poor chatgpt lol
@aliozgunakyuzstudent7942
@aliozgunakyuzstudent7942 Жыл бұрын
I've been waiting for 5 years to pass the course thx for the video
@onurcanisler
@onurcanisler 8 ай бұрын
😂
@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!
@terrasai2857
@terrasai2857 Жыл бұрын
I’ve waited 5 years just for your video 😂
@MichaelSambol
@MichaelSambol Жыл бұрын
😂🫱🏼‍🫲🏽
@lin2k4
@lin2k4 Жыл бұрын
Procrastination pays off, I can watch the whole red-black playlist all at once now :D
@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ч
@ДмитроБережний-т8ч 2 жыл бұрын
@@kskbekfoznwd курсова робота не шкодує нікого)
@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 2 жыл бұрын
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
@jian-de
@jian-de 6 ай бұрын
5 years late? you're just on time for me! thanks for the video
@MichaelSambol
@MichaelSambol 6 ай бұрын
Love it! Welcome.
@aliciachoi
@aliciachoi 6 ай бұрын
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👍
@jeez123
@jeez123 6 ай бұрын
I'm so lucky that you released this now right when i need it
@astrixinthestars1047
@astrixinthestars1047 7 ай бұрын
right when we needed him most, he reappeared
@davidporterrealestate
@davidporterrealestate 2 жыл бұрын
I've been waiting for this
@Лев-й7я
@Лев-й7я Жыл бұрын
Я ждал ето 20 секунд пока реклама шла
@amanasati5198
@amanasati5198 2 ай бұрын
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 😂😂
@ArisTheMage
@ArisTheMage 6 ай бұрын
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
@remonataf8960
@remonataf8960 Жыл бұрын
bro casually waited 5 years to continue his masterpiece thank god I started learning red black trees after he finished this playlist
@MichaelSambol
@MichaelSambol Жыл бұрын
Just in time 🤪
@remonataf8960
@remonataf8960 Жыл бұрын
😂😂😂😂@@MichaelSambol
@amanbisht579
@amanbisht579 Жыл бұрын
dude how tf is this channel not discovered by people yet
@MichaelSambol
@MichaelSambol Жыл бұрын
slow and steady... thanks for watching!
@yzerjakenavarroza
@yzerjakenavarroza 5 ай бұрын
this is so funny T-T I'm shocked with your voice changing
@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.
@BigDoke
@BigDoke 2 жыл бұрын
Perfect timing man, I have an exam in 3 days :D
@Jeshuakrc
@Jeshuakrc 5 ай бұрын
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 5 ай бұрын
🤦🏻‍♂️
@MichaelSambol
@MichaelSambol 5 ай бұрын
🤦🏻‍♂️
@AladdinPersson
@AladdinPersson 2 жыл бұрын
Bro your explanations are top notchh
@MichaelSambol
@MichaelSambol 2 жыл бұрын
thanks bro! yours too.
@mohitpal1505
@mohitpal1505 Жыл бұрын
Why did you consider NiL to be red in the end???
@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
@animeboy9355
@animeboy9355 Жыл бұрын
damn bro literally returned after 5 year
@MichaelSambol
@MichaelSambol Жыл бұрын
Back!
@judepope6196
@judepope6196 3 ай бұрын
I'm coming for the delete-mixup haha
@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 `==` ?
@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 :)
@devashishathawale4807
@devashishathawale4807 11 ай бұрын
The sequel we needed
@saraghosalkar4322
@saraghosalkar4322 2 жыл бұрын
DSA God ! Thank you so much :)
@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 9 ай бұрын
It is not null, it is NIL node, which is still a node with a parent.
@RockOfGreece
@RockOfGreece 10 ай бұрын
what about the case that both children are nill?
@MichaelSambol
@MichaelSambol 10 ай бұрын
this case? github.com/msambol/dsa/blob/master/trees/red_black_tree.py#L182
@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 :)
@Enzoerb
@Enzoerb 4 ай бұрын
thankfully I am watching this 7 years late
@MichaelSambol
@MichaelSambol 4 ай бұрын
just in time
@tauheedakbar3524
@tauheedakbar3524 Жыл бұрын
Nice work man thanks
@kapt0xa_by
@kapt0xa_by 3 ай бұрын
how can i call fixup for deleted node???
@MichaelSambol
@MichaelSambol 3 ай бұрын
github.com/msambol/dsa/blob/master/trees/red_black_tree.py :)
@chhapriyt5686
@chhapriyt5686 11 ай бұрын
When l created red black tree why i delete node what the fuck 😂😂😂
Red-black trees in 6 minutes - Delete Fixes
5:49
Michael Sambol
Рет қаралды 43 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 497 М.
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 269 #shorts
00:26
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
Calculus at a Fifth Grade Level
19:06
Lukey B. The Physics G
Рет қаралды 8 МЛН
Introduction to CPU Pipelining
10:29
Merlin Wellington
Рет қаралды 44 М.
No One Hires Jr Devs So I Made A Game
39:31
ThePrimeTime
Рет қаралды 239 М.
Red-black trees in 5 minutes - Insertions (strategy)
5:38
Michael Sambol
Рет қаралды 481 М.
But what is a neural network? | Chapter 1, Deep learning
18:40
3Blue1Brown
Рет қаралды 17 МЛН
Red-black trees: Samuel's tutorial
24:20
Samuel Albanie
Рет қаралды 7 М.
Red-black tree deletion: steps + 10 examples
23:46
Alena Chang
Рет қаралды 10 М.
Breadth First Search (BFS): Visualized and Explained
10:41
Reducible
Рет қаралды 212 М.