Question: Please use C++, thank you! Question 1: Does inserting a node into a red-black tree, re-balancing, and then deleting it result in the original tree?
Please use C++, thank you!
Question 1: Does inserting a node into a red-black tree, re-balancing, and then deleting it result in the original tree? Question 2: Does deleting a node with no children from a red-black tree, re-balancing, and then re- inserting it with the same key always result in the original tree? Your answers to these questions need to include a specific example of a tree showing the original tree, the results of the re-balancing, and the final tree after deleting. Include a graphic of your tree generated in a graphics program, or the Red-black tree visualization website that we showed irn class: https://www.cs.usfca.edu/ galles/visualization/RedBlack.html Your answer also needs to include an explanation of how the algorithm proceeds to insert and delete nodes in the tree. Include information such as which node is the parent, grandparent, and uncle at each step, and which node is the argument for the left and right rotate steps. Refer to your specific trees in your explanation Question 1: Does inserting a node into a red-black tree, re-balancing, and then deleting it result in the original tree? Question 2: Does deleting a node with no children from a red-black tree, re-balancing, and then re- inserting it with the same key always result in the original tree? Your answers to these questions need to include a specific example of a tree showing the original tree, the results of the re-balancing, and the final tree after deleting. Include a graphic of your tree generated in a graphics program, or the Red-black tree visualization website that we showed irn class: https://www.cs.usfca.edu/ galles/visualization/RedBlack.html Your answer also needs to include an explanation of how the algorithm proceeds to insert and delete nodes in the tree. Include information such as which node is the parent, grandparent, and uncle at each step, and which node is the argument for the left and right rotate steps. Refer to your specific trees in your explanation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
