3.2 Types Of Imbalances | Red Black Trees | Types Of Rotations | with Examples
HTML-код
- Опубликовано: 31 июл 2024
- In this video, I will cover the all the 8 types of imbalances in Red Black Trees and the corresponding rotations and coloring that we need to perform inorder to counter those rotations.
You will need to learn these imbalances and rotations in order to completely understand Insertion and Deletion in Red Black Trees in the upcoming videos.
Timestamps:
0:00 Introduction : Why imbalance occurs?
1:51 Terminology
5:12 Eight Types of imbalances
Tags:
#redblacktrees #imbalances #rotations #dsa #RedBlackTrees #balancedbst #data structures #advanceddatastructures #advanceddsa #cse #IT
One of the best explanations on advanced datastructures I have ever seen I generally do not comment and this might be my first comment on RUclips
The quality of your tutorials is amazing.
Awesome brother keep it up and thank you for your hardwork.
Keep it up and please upload the remaining videos as soon as possible .
This comment really made my day🖤🖤🖤 Means a Lot
Thanks A Lot for acknowledging my efforts☺️
Kindly share my channel with your friends😉
Forsure brother keep up the good work.
I've always loved simplifying things by chunking them together, but I've never seen any youtube teacher do that before, this concept was so difficult for me to understand, I was trying for months, but now one day before my exam when I saw this, it's so easy and simple to grasp the concept and the way you explain it is amazing! Thank you so much! Please upload more topics, I'd love to learn from your channel!
Thanks a lot for taking out time to acknowledge my efforts and I feel it's all worth it for me if its made things so crystal clear for you😊
If you change terminology and call the new node N, your other nodes can be simply P, U, G, No subscript.
Hello sir, I have a small doubt. when you have recolored the relatives in the first example, the root node color changes to red, which violates the property of the RBT which states that the the root node should always be Red. please help
Wonderful! For LLr case, we cannot make gu to be red intitially because for the imbalance to occur, pu must be red,and uncle is also red(since the case is LLr),so a node(gu here) can have 2 red children only when its black.Hence the fact.
Perfect! 🔥
In LL and RR rotation why the colour of parent and grandparent colour is changed after rotation?🙏
Yes sir ,Please answer
Hello! I think it is because after the rotation Pu fathers u (red) and Gu (originally black). As red nodes must have both of their children black Pu becomes black. Gu becomes red probably to keep the same black height from root node to Uu. Well, I'm not 100 % sure. This is just the way I understand it. 😅
Amazing explaination
Thanks A Lot 🖤
Please share this video if you liked it😉
Thank you very much for this impressive video. I have a question regarding XYz rotations for z being red. In such cases, what would happen if the grandparent happens to have itself at the beginning a black sibling and a red parent? I imagine that, after the insertion, in such case, the hypothetical red "great grandparent" would be in conflict with his newly black child. How would it be solved?
Ok. I saw in the following video that the whole Gu subtree is to be reinserted into the red great grandparent. Thanks 🙏