(Parent reference for BST) Redefine TreeNode by adding a reference to a node’s parent, as shown below:
Reimplement the insert and delete methods in the BST class to update the
parent for each node in the tree. Add the following new method in BST:
/** Return the node for the specified element.
* Return null if the element is not in the tree. */
/** Return true if the node for the element is a leaf */
private boolean isLeaf(E element)
/** Return the path of elements from the specified element
* to the root in an array list. */
Write a test program that prompts the user to enter 10 integers, adds them to
the tree, deletes the first integer from the tree, and displays the paths for all leaf
nodes. Here is a sample run:
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here