Question: Question 9 Consider the pseudocide operation readTree. a . What binary search tree results when you execute readTree with a file of the six integers
Question Consider the pseudocide operation readTree.
a What binary search tree results when you execute readTree with a file of the six integers
b Is the resulting tree's height a minimum? Is the tree complete? Is it full?
Builds a minimumheight binary search tree from sorted values in a file.
Returns a pointer to the tree's root.
readTreen: integer: BinaryNodePointer
if
Get the root
treePtr pointer to new node with nu ptr as its child pointers
rootItem next item from file
treePtr setItemrootItem
Construct the left subtree
leftPtr readFuTreetreePtrgetLeftChidPtr
treePtr setLeftChildPtr leftPtr
Construct the right subtree
rightPtr readFuTreetreePtrgetRightChildPtr
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
