1. Modify the LinkedBinaryTree class to formally support the Cloneable interface, as described in Section 3.6.2. Give an efficient algorithm that computes and prints, for every position p of a tree...
Articles Posted by admin
1. Describe how to clone a LinkedBinaryTree instance representing a proper binary tree, with use of the attach method.2. Describe how to clone a LinkedBinaryTree instance representing a (not...
We can simplify parts of our LinkedBinaryTree implementation if we make use of of a single sentinel node, such that the sentinel is the parent of the real root of the tree, and the root is...
1. Give an O(n)-time algorithm for computing the depths of all positions of a tree T, where n is the number of nodes of T.2. The balance factor of an internal position p of a proper binary tree is...
Add support in LinkedBinaryTree for a method, pruneSubtree(p), that removes the entire subtree rooted at position p, making sure to maintain an accurate count of the size of the tree. What is the...
Recent Comments