(Parent reference for Tree24) Redefine Tree24Node to add a reference to a node’s parent, as shown below: Add the following two new methods in Tree24: public Tree24Node getParent(Tree24Node node)...


(Parent reference for Tree24) Redefine Tree24Node to add a reference to a node’s parent, as shown below:


Add the following two new methods in Tree24:


public Tree24Node getParent(Tree24Node node)

 Returns the parent for the specified node.


public ArrayList> getPath(Tree24Node node)

 Returns the path from the specified node to the root in an


array list.


 Write a test program that adds numbers 1, 2, ..., 100 to the tree and displays the


paths for all leaf nodes.


Nov 14, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here