Question: Consider the following binary search tree, ordered using the a) Using the simplest binary search tree (BST) insertion algorithm (no balancing), show the tree that
Consider the following binary search tree, ordered using the
a) Using the simplest binary search tree (BST) insertion algorithm (no balancing), show the tree that results after inserting into the above tree the nodes 80, 65, 73, 15, 37 and 25 in that order. (If you're not skilled with a drawing tool, use a simple text form of the tree. For example, the tree depicted above could be shown as
50 20 60 10 40 70 30
Use enough space to distinguish left children from right children. Another way to represent the tree in text form (that distinguishes left children from right children) is
50 20 10 40 30 xx 60 xx 70
b) After inserting the nodes mentioned in part a, what would be printed out by in-order, pre-order, and post-order traversals of the tree (assume your traversal function prints out the number at each node as it is visited)?
c) After inserting the nodes mentioned in part a, what is the resulting BST after you delete the node 30, then the node 20? (Again, just use a simple deletion algorithm with no balancing. If you have an option of making a choice, any correct choice is acceptable.)
[2o | Tso * o o o | 30Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
