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

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

  • @coderb7081
    @coderb7081 Год назад +3

    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 .

    • @uzairjavedakhtar3718
      @uzairjavedakhtar3718  Год назад +1

      This comment really made my day🖤🖤🖤 Means a Lot
      Thanks A Lot for acknowledging my efforts☺️
      Kindly share my channel with your friends😉

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

      Forsure brother keep up the good work.

  • @vkstudy3764
    @vkstudy3764 9 месяцев назад +1

    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!

    • @uzairjavedakhtar3718
      @uzairjavedakhtar3718  8 месяцев назад

      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😊

  • @richardc4352
    @richardc4352 6 месяцев назад

    If you change terminology and call the new node N, your other nodes can be simply P, U, G, No subscript.

  • @singhyash3302
    @singhyash3302 7 месяцев назад

    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

  • @mr.curious1329
    @mr.curious1329 2 года назад

    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.

  • @madhuragrawal2793
    @madhuragrawal2793 Год назад +1

    In LL and RR rotation why the colour of parent and grandparent colour is changed after rotation?🙏

    • @vijaylata473
      @vijaylata473 Год назад +1

      Yes sir ,Please answer

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

      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. 😅

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

    Amazing explaination

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

    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?

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

      Ok. I saw in the following video that the whole Gu subtree is to be reinserted into the red great grandparent. Thanks 🙏