In: Computer Science
Consider the following splay tree:
Show the paths from root to node 12, 10, 9, 5, and 1 after search node 3. (Sample answer: for the above splay tree, the path from root to node 9 can be expressed as 10, 4, 6, 8, 9.)
The path from root to node 12:Question Blank.The path from root to node 10:Question Blank.The path from root to node 9:Question Blank.The path from root to node 5:Question Blank.The path from root to node 1:Question Blank
As the question seems to have in sufficient information so, i am taking an example from my own side just to show the right percedure.
In this tree the root node is (10) so,
The path form root to node 12 is (10, 11, 12)
The path from root to node 10 is (10)
The path from root to node 9 is (10, 4, 6, 8, 9)
The path from root to node 5 is (10, 4, 6, 5)
The path from root to node 1 is (10, 4, 2, 1)
according to question first search node 3 than go to the node so the answer is
The path form root to node 12 is after search node 3 (10, 4, 2, 3, 3, 2, 4, 10, 11, 12)
The path from root to node 10 is after search node 3 (10, 4, 2, 3, 3, 2, 4, 10)
The path from root to node 9 is after search node 3 (10, 4, 2, 3, 3, 2, 4, 6, 8, 9)
The path from root to node 5 is after search node 3 (10, 4, 2, 3, 3, 2, 4, 6, 5)
The path from root to node 1 is after search node 3 (10, 4, 2, 3, 3, 2, 1)