5.17 Red Black Tree Insertion | Insertion Algorithm | Data Structure Tutorials

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

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

  • @ekanshgaming5854
    @ekanshgaming5854 3 года назад +322

    I am a professor in CSE deptt. But, I learnt almost every lecture of Data structure from your channel and then get a confidence to teach my students. Keep it up. God Bless you. Certainly, u shall reach the height.

    • @solsys8875
      @solsys8875 3 года назад +6

      Kindly tell us which clg you prof at?

    • @ekanshgaming5854
      @ekanshgaming5854 3 года назад +10

      @@solsys8875 Chitkara University Punjab

    • @jaiBisht0001
      @jaiBisht0001 2 года назад +90

      @@ekanshgaming5854 no one is going to take admission in your college after this 😁

    • @j_ourney25
      @j_ourney25 2 года назад +13

      I know why you are take this lectures bcz🤣🤣

    • @j_ourney25
      @j_ourney25 2 года назад +4

      Prof.

  • @atdinfinity
    @atdinfinity 5 лет назад +380

    No teacher taught Red black tree by actually using Red and black markers which made it difficult to understand.
    You did it neatly and your explanation adds clarity. Thank you for this video ma'am 😊😊😊

    • @aavyaaavya9412
      @aavyaaavya9412 4 года назад +3

      👌👌👌👌👌

    • @junmun5035
      @junmun5035 3 года назад +5

      No professor has those kind of double marker handling skills 😤

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

      @@junmun5035 gatau aja lu binus

    • @Thelearner-dc5sd
      @Thelearner-dc5sd 8 месяцев назад

      Our profs didnt explain at all lol

  • @mahlomolamohlomi2569
    @mahlomolamohlomi2569 2 года назад +51

    you deserve an award for being the best youtube teacher..... i was struggling with this concept ..now i guess i'm going to past with test on monday...thank you so much..keep on doing the good job

  • @roushansingh8904
    @roushansingh8904 4 года назад +37

    it is one of the toughest section in the DS. ..
    you worked extremely hard for this....quite evident from the video...🙏🙏🙏

  • @londonstudioliving
    @londonstudioliving 4 года назад +180

    Oh my gosh this explanation has made it so clear !!! I was struggling badly. Thank you x

  • @reshmareshu1194
    @reshmareshu1194 Месяц назад +1

    Yes mam!
    If every node has black it can be red black tree
    And also check the number of black nodes when traverse in every path!!
    Thank you so much for the clear-cut explanation 😊❤

  • @dhairya-varshney
    @dhairya-varshney 2 года назад +234

    Point to remember: If rotation is LL or RR, then GP and P node will be recolored, if rotation is RL or LR then GP and Child node is recolored.
    GP means grand Parent, P means Parent.

    • @anukshadutta8824
      @anukshadutta8824 2 года назад +8

      Thanks for this! I was a little confused in rule 4a. But this solved it

    • @shashwatchawla
      @shashwatchawla 2 года назад +5

    • @khemendrabhardwaj2552
      @khemendrabhardwaj2552 2 года назад +4

      thanks
      nice observation btw

    • @maxyMaverick
      @maxyMaverick 2 года назад +5

      broo u found the glitch in the matrix , thnks for the glitch :)

    • @maxyMaverick
      @maxyMaverick 2 года назад +2

      bro can u tell anything same for red black tree deletion :)

  • @JyotiSharma-wb1vy
    @JyotiSharma-wb1vy 3 года назад +4

    Just wow!! Very well explained. Everytime when i have to study any topic i just simply write topic name and then by Jenny. You are my first priority.

  • @sohamshinde1258
    @sohamshinde1258 4 года назад +48

    Ma'am you taught it very nicely. Also your algorithm is very helpful, but I would like to have some edits as follows :
    1) If tree is empty, create newnode as root node
    with colour Black.
    2) If tree is not empty, create newnode as leaf
    node with colour Red.
    3) If parent of newnode is Black then
    exit.
    4) If parent of newnode is Red, then check the colour of parent’s sibling
    of newnode:
    a) If colour is Black or NULL
    then do suitable rotation among node, parent and grandparent and then recolour
    the parent and grandparent.
    b) If colour is Red then recolour the parent and parent’s sibling and
    also check if grandparent of newnode is not root node then recolour if and
    recheck from the grandparent.

  • @HornOKPlease
    @HornOKPlease 3 года назад +4

    You're so good at Data Structures, you can pass any interview - wow

  • @fahmidalrifat1238
    @fahmidalrifat1238 4 года назад +15

    Perfect lecture exist , Very much grateful , Go ahead with new new awsome lectures like this

  • @devipriya7246
    @devipriya7246 3 года назад +2

    Super. U r teaching very well. Before that I am totally confused. Now I am clear.

  • @anasbari007
    @anasbari007 2 года назад +4

    Never Seen Such An Amazing content 💯.My Professor should also come here before proceeding to the class 😂. 27 minutes kab nikal gaye pata hi nahi chala...

  • @swortkeiser1988
    @swortkeiser1988 4 года назад +18

    This is actually amazing. I love how much work went into this video and how well everything was explained.

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

    Mam the way you explained the red black tree is simply awesome

  • @shubhamk840
    @shubhamk840 3 года назад +1

    This channel is going to be a big name among online cs education channels.

  • @sillytech2008
    @sillytech2008 3 месяца назад +4

    When i did my BTECH i used to watch our videos and now doing Mtech still watch your videos....most of the youtuber take easy examples where there is no confusions and diffcult scenarios that a student might face but you take the examples considering all the scenarios and explain...Thank you for your efforts.

    • @anonymouss6800
      @anonymouss6800 Месяц назад

      Can you share ur some imp. tips and instructions for mtech cs??

    • @ZMan-lx6pg
      @ZMan-lx6pg Месяц назад

      Did you get no job offer or did you want to pursue research? (Getting personal here XD)

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

    My mind is blown. You've made it sooo easy. Absolute mad lad

  • @fahmidalrifat1238
    @fahmidalrifat1238 4 года назад +7

    Your video cover all deep concepts of the topic , That helps a lot ...hard topic become water like ...Thanks a lot for every thing mam

  • @vedgupta3589
    @vedgupta3589 3 года назад

    are mam izzat bdd gyi meri nazron me apki is video ko dkhne ke baad
    salute hai mam apko

  • @hassanelnaggar3647
    @hassanelnaggar3647 Год назад +57

    Here are the algorithm notes written on the board:
    1. If tree is empty, create newnode as rootnode with color Black
    2. If tree is not empty, create newnode as leaf node with color Red
    3. If parent of newnode is Black then exit
    4. If parent of newnode is Red, then check the color of parent’s sibling of newnode:
    (a) If color is Black or null then do suitable rotation and recolor (such that the root of the subtree is Black and children are Red)
    (b) If color is Red then recolor (parent and parent’s sibling) and also check if parent’s parent of newnode is not rootnode then recolor and recheck
    rules:
    -> root color = Black
    -> no two adjacent Red nodes
    -> count of Black nodes in each path is equal

  • @harshitraj8409
    @harshitraj8409 4 года назад +1

    Best Explanation of Red Black 🌲 on RUclips.

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

    Your method of teaching is very good and understanding i very understand red black tree you insert data in my mind also

  • @azeemushanali6943
    @azeemushanali6943 5 лет назад +11

    Tomorrow is my exam and if this question comes in my exam.I owe you my 7 Marks.Thank You for being my savior. ;-)

  • @furrypuppy9152
    @furrypuppy9152 2 года назад +2

    Thank you so much miss!
    Your explanation is very precise.
    I always watch your videos whenever I have doubts to clear my doubts.

  • @ShoghikGevorgyan-xo8oe
    @ShoghikGevorgyan-xo8oe 8 месяцев назад

    The whole day I spent trying to understand this algorithm, and understood only after watching this video. Thank you so much.

  • @Black-xy4pj
    @Black-xy4pj 2 года назад +11

    I am so grateful for this video!!! This is the best explanation on red-black trees! Thank you!

  • @AmanXvlogs.
    @AmanXvlogs. 3 года назад +1

    Thanku Jenny mam...you are professor of Algorithm.

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

    This is the simplest explanation of red black tree insertion, thank you so much!! ❤

  • @vikassir7394
    @vikassir7394 3 года назад +1

    Best Best Best......10000 explaination ma'am 🙏🙏🙏

  • @codeonly21
    @codeonly21 Месяц назад +1

    thanks a lot mam , today is my exam and i was revising concepts early morning and your videos help me a lot in understanding data structures.❤😊

  • @mdh5213
    @mdh5213 4 года назад +9

    I go to college in NEW YORK and honestly i didnt understand this until watching your video. It was well explained. Thank you so much

  • @AmanSharma-uz9vu
    @AmanSharma-uz9vu 4 года назад

    Yes it is possible to have a red black tree with all nodes in black color.
    Perfect teacher is not a myth anymore 🔥

  • @NaveenGupta-x9m
    @NaveenGupta-x9m Год назад

    best mam , what a fantastic way to make all things clear in a very simple way

  • @willturner3440
    @willturner3440 3 года назад +8

    Your channel got viral in our school :-D

  • @IT-hj1vi
    @IT-hj1vi 2 года назад +1

    Incredible !! the best

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

    yes a red black tree with just root node that is black exists so red black tree with all black nodes is possible ...great explaination

  • @dharshimahen9150
    @dharshimahen9150 4 года назад +1

    You are really best lecturer mom... you are work hard for the students.... I really like your teaching style and also I were understood all the things very well... thank you so much mam

  • @praveen7028
    @praveen7028 3 года назад

    Kaafi sahi explanation tha boss! Great work!

  • @nallagondachandrika9605
    @nallagondachandrika9605 2 года назад +1

    Tq so much mam by this vedio I understood the red black trees concept very nicely tq mam

  • @gaatutube
    @gaatutube 4 года назад

    This RB Trees topic is definitely one of the hardest lectures in any data structure classes. Seriously ... who thought up this crazy algorithm in the first place ?!!

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

    very elaborative explanation..got the full clarity of node insertion and rotations in this video..Thank you so much

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

    You are the reason I got full marks in midterm exam Thank you so much mam...

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

    It was such a wonderful explanation thank you so much mam 🎉🎉🎉

  • @noobieencounters
    @noobieencounters 3 года назад +1

    Explanation is Clear as day...aah I'm gonna pass this sem😌

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

    this is the best explanation by far, thank youuuu

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

    Maam . Thanks a lot. This is very confusing topic for rotation but now everything is clear to me.( those having confusion just read gfg algo once then watch video u will surely perform well in exams)

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

    Very good lecture... Your patience is best...

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

    Jenny you are among the best thanks for your effort

  • @enokmalik
    @enokmalik 3 года назад +3

    Thank you for doing such a long example. I finally understand it. :)

  • @shivasachdeva6634
    @shivasachdeva6634 4 года назад +1

    Wow mam what an explanation. Amazing, outstanding every word is less for your praise.

  • @saritakumari-oh8fs
    @saritakumari-oh8fs 4 года назад +18

    Yes it is possible to have all black nodes in Red black tree . Thank you for making the toughest topic easy for us

    • @siddeshwarmadargave1403
      @siddeshwarmadargave1403 9 месяцев назад

      How

    • @siddeshwarmadargave1403
      @siddeshwarmadargave1403 9 месяцев назад

      Because the last node u insert will always be red .......irrespective of any operations u do in above of tree

    • @aEDITS4567
      @aEDITS4567 Месяц назад

      Just the root ⚫​@@siddeshwarmadargave1403

  • @akashnaveen7475
    @akashnaveen7475 3 года назад +1

    Thank you ma'am you save my tomorrow's CT 🔥❤️

  • @shreechatane9215
    @shreechatane9215 3 года назад +1

    Thank you for putting so much efforts.

  • @raushansingh2203
    @raushansingh2203 5 лет назад +3

    Thank you so much ma'am for such a clear & superb explanation. Before this i always in confusion, but now its so clear.

  • @petros-eri
    @petros-eri 4 года назад +6

    You are perfect lecturer , thank you Professor of Algorithms!

  • @praveshvajpayee4667
    @praveshvajpayee4667 3 года назад +1

    I really liked your teaching skill. please carry on :)

  • @mabenyjohnson6908
    @mabenyjohnson6908 2 года назад +1

    After several hours of jumping from one youtube video to another in search for solid understanding in this topic, finally came across this. Keep up the good work!

  • @hudaankara5616
    @hudaankara5616 2 года назад +1

    Great explanation. Thank you 🌹

  • @shrijangoswami2061
    @shrijangoswami2061 4 года назад

    Fantastic & Mindfulness Explantation👌👌👌👌

  • @ramdwivedi6986
    @ramdwivedi6986 4 года назад +1

    great effort mam you have explained it so easily that I learn it in a single attempt.

  • @chrisaes3235
    @chrisaes3235 3 года назад

    Many thanks from Germany! Very, very helpful! :)

  • @Prajjwal4242
    @Prajjwal4242 4 года назад

    Wow ma,am before watching this video red black tree was hard nut to crack for me but after watching this it's a peace of cake for me. Thanks again ma'am.

  • @sidrubx073
    @sidrubx073 9 месяцев назад

    For a perfect BST a red black tree with all the nodes black colour is possible .....
    Thank you mam for this lecture ❤

  • @shivamjaiswal2434
    @shivamjaiswal2434 5 лет назад

    Pura semester nikal gya ab jake samjh aaya... Tq

  • @saaagararts
    @saaagararts 5 лет назад +79

    27:15 *ANSWER is YES* We can have a Red-Black Tree with
    *ALL BLACK* nodes.

    • @neelsoni8605
      @neelsoni8605 5 лет назад +2

      Be oyy, kyar thi bhane 6e be? Kale exam 6ene Me haju hamna start karyu 😅😅

    • @saaagararts
      @saaagararts 5 лет назад +4

      @@neelsoni8605 1 week thi *DAA* karta hta bro! 😍

    • @neelsoni8605
      @neelsoni8605 5 лет назад +1

      @@saaagararts 🙏🏾

    • @dhruvilsheth6767
      @dhruvilsheth6767 5 лет назад +3

      Yes bro you are Sagus

    • @prabhattiwari4125
      @prabhattiwari4125 4 года назад +5

      Yes, and that tree will also be a complete binary tree.

  • @psc_youtuber
    @psc_youtuber 3 года назад +1

    Very nice explanation. Thank you so much mem!

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

    i started watching your videos because needed to get understanding on trees, but now i like to watch it because you're very beautiful. This reminds me of my childhood, having crush on the teacher. by the way i'm a working professional with 6 yrs of exp., just in case you're not married and is of similar age (i'm 2016 batch pass out btech) , then please do reply back. :)

  • @Anilkumar-Ch17
    @Anilkumar-Ch17 3 года назад

    made it clear in single attempt..thank you

  • @freefiremafia9336
    @freefiremafia9336 2 месяца назад +1

    yes it is possible , all black nodes in red black tree but it also have fully balanced binary search tree

  • @learntolead6250
    @learntolead6250 4 года назад

    Am happy for your new family member ❣

  • @abhinavkukku7947
    @abhinavkukku7947 5 лет назад +3

    It is much more help full to me
    For understanding this lession
    Thank you
    Thank you
    So much mam
    😊😊😊😊😊

  • @deepalidabas4373
    @deepalidabas4373 3 года назад

    Thankyou so much mam .. I am Doing BCA and your videos helped me to clear so many subjects . Lots of love to u 🤗🤗🤗🤗🤗🤗🤗 the best teacher

  • @PrinceKumar-xc6zx
    @PrinceKumar-xc6zx 5 лет назад

    Thankq. Thankq thankq.. Alots of thanq maam.. Ur teaching way is very nice... Big fan.

  • @btsindianarmygirl995
    @btsindianarmygirl995 4 года назад +1

    Thank u mam it helps me alot ,in corona holidays I forget everything ,now it is very easy to learn by ur videos mam .

  • @aariffmohd4980
    @aariffmohd4980 21 день назад

    Thanks a lot mam, even after years this is helpful 😊

  • @aayushiaggarwal9949
    @aayushiaggarwal9949 3 года назад

    Best explanation of each step which helped us to understand it very clearly.

  • @sharique846
    @sharique846 5 лет назад +2

    thank you for your great effort in extracting the step of rb tree insertion ,,it really helped me yesterday....

  • @ТатьянаТомайлы-ш7ц
    @ТатьянаТомайлы-ш7ц 2 года назад +1

    What a great explanation! Thank you very much

  • @GovindaPandeytechworks
    @GovindaPandeytechworks 3 года назад

    Thanks for sharing your knowledge and cute smile at the end of each video.

  • @shivrajsingh-qv3tl
    @shivrajsingh-qv3tl 4 года назад +2

    Toughest section from data structures but you are such a damn teacher 🙏😻

  • @vinayaksharma-ys3ip
    @vinayaksharma-ys3ip 3 года назад

    Bestest Lecture mam💯💯💯👍

  • @shafisd2072
    @shafisd2072 5 лет назад +2

    Hii mam yesterday I completed ....my exam ....without leaving any question.....thank you....😍 u can teach better than our faculty...🙏🙏

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

    Excellent detailed explanation, it is very helpful. Thank you for your efforts.

  • @bothsapriyanka3540
    @bothsapriyanka3540 4 года назад

    Tq for this video mam...
    Answer for your question is YES in red black trees we have all nodes in black...

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

    Amazing explanation.... Thankyou so much mam😊🙏🙏

  • @vakhariyajay2224
    @vakhariyajay2224 2 года назад +1

    Thank you very much. You are a genius. 👍👍🙏🙏👌👌🔝🔝

  • @anshumansharma6650
    @anshumansharma6650 2 года назад +1

    so easily explained ❤️😘😍💐🙏🏻🙇🏻‍♂️

  • @venkateshvenky2880
    @venkateshvenky2880 5 лет назад

    Your lectures are simply awesome.....

  • @SAUMYAJINDAL-xy7wg
    @SAUMYAJINDAL-xy7wg Год назад

    Thanks for the amazing and deep explanation.
    No, It is not possible to have all black color nodes in a red black tree because, whatever we do, the last node must be red of the tree.

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

    Thank you so much, you explained it alot easier with the example and requirements to meet for a Red-Black Tree. Thanks for this video.

  • @raniyaliyakath4047
    @raniyaliyakath4047 27 дней назад

    Beautifully explained❤

  • @chhawiprasad3755
    @chhawiprasad3755 4 года назад +1

    Oh my god!! Thank you so much.. you're such a saviour !!

  • @sravanthreddygurram4903
    @sravanthreddygurram4903 3 года назад

    It is very clear mam
    Very Thankfull to u mam...

  • @juleekurmi3451
    @juleekurmi3451 Месяц назад +2

    yes it is possible to have all black nodes in red black tree.

  • @piyushmishra860
    @piyushmishra860 2 года назад +1

    Tq so muchh mam amzing explanation mam

  • @harshurane16
    @harshurane16 4 года назад

    very nice . You cleared concept and all doubts of "Red Black " from this video.thank u

  • @zainuddin9484
    @zainuddin9484 4 года назад +15

    Yes, Every node in Red Black tree can be black, but i guess the tree must be perfectly balanced so that there will be same number of black nodes in each path.

  • @jenniefine9456
    @jenniefine9456 4 года назад

    your videos is like Marvel movies,if you not watch previous one then you can't understand the current video of series
    But I watch them one by one and learn.

  • @nainys_misfit_World
    @nainys_misfit_World 4 года назад

    Amazing 👌🙌 bhutt easily pura process bhi yaad hogya