Examine the following binary search tree and answer the questions in Exercises 3
ID: 3805900 • Letter: E
Question
Examine the following binary search tree and answer the questions in Exercises 36-39 The numbers on the nodes are labels so that we can talk about the nodes: they are not key values within the nodes. 36. If an element is to be inserted whose key value is less than the key value in node 1 but greater than the key value in node 5, where would it be inserted? 37. If node 1 is to be removed, the value in which node could be used to replace it? 38. 4 275 168 3 is a traversal of the tree in which order? 39. 1 2 457 3 6 8 is a traversal of the tree in which order?Explanation / Answer
36. the node should be the right child of 5 if (x.key>5.key && x.key<1.key)
37 the node(6) would be inserted because in question its key value would be the least in right sub tree
38 inorder traversal(left root right).
39.preorder(root left right)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.