Q1) (10 points) Answer the following questions in a separate document.
a) (2 points) Assign the keys 57, 135, 22, 35, 68, 124, 77, 150, 95, 88 to the nodes of the binary search tree shown below. Feel free to do trial and error to fill the tree with the given list of keys.
b) (2 points) There is a list of random keys and a tree with the same predefined tree structure in problem a) above. The number of keys in the list is the same as the number of available nodes of the tree. We want to systematically fill in all the nodes of the tree with the keys from the randomly ordered list of any set of keys. Describe a deterministic way to fill the tree completely.
c) (2 points) Starting from the root node, we want to populate a BST tree with the keys from a given list without altering its order. Using the keys and the tree in question a) as an example, show the ordered list of the keys which can be sequentially inserted into the tree. Also explain and demonstrate how you would get such a list systematically using the tree from question b). Please limit your description to a sentence or two.
d) (2 points) Describe why this specific instance of a binary search tree can't be colored to form a valid red-black tree even without populating keys.
e) (2 points) Now let's try to do two rotations to make it an RB tree. Describe how rotations are done and show the final picture of an RB tree showing each node with key value and its color.
Q1) Deliverable:
Upload a PDF document with the answers to 5 questions with a picture of an RB tree from the last question (e)