Harvard University Binary Search Tree Questions
Description
Let T is a BST. Suppose we wish to augment the nodes of this tree with the attribute x.height, which
represents the height of the subtree rooted at x. Write the pseudo-code for an algorithm AssignHeight(T)
which correctly sets the value of x.height for each node in the tree. Justify the runtime of O(n).
When an insert is made into such a tree, is it possible to update the values of x.height in O(h) time?
Justify your answer.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."