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

Add the following two new methods in Tree24:
public Tree24Node
Returns the parent for the specified node.
public ArrayList
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.
Tree24Node elements: ArrayList An array list for storing the elements. child: ArrayList An array list for storing the links to the child nodes. parent: Tree24Node Refers to the parent of this node. +Tree24 () +Tree24 (o: E) Creates an empty tree node. Creates a tree node with an initial element.
Step by Step Solution
3.32 Rating (164 Votes )
There are 3 Steps involved in it
ANSWER public class Tree24Node private ArrayList elements private ArrayList child pr... View full answer
Get step-by-step solutions from verified subject matter experts
