-->
当前位置:首页 > 题库 > 正文内容

主观题:RB Tree Insertion -- Case 2

Luz3年前 (2022-03-02)题库630

![捕获.JPG](~/9bbc51d2-ff37-47ec-9ee5-4e13a8cbc4c5.JPG)

During the insertion of a red-black tree, in case 2: why don't we apply an AVL double rotation and flip the collors of the root and the right-most node?


![屏幕截图 2022-03-02 222641.png](~/308032d5-daff-4679-85e9-36b414a9e630.png)






答案:It doesn't work.


![屏幕截图 2022-03-02 223218.png](~/83d239a8-05db-4d16-9434-0cdf8c6d86e8.png)

The purple tree would have one extra black node on its path to the root.

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。