(Solved) : Urgent Parent Reference Bst Redefine Tree Node Adding Reference Node S Parent Shown Reimpl Q35579746
(Parent reference for BST) Redefine Tree Node by addinga reference to a node’s parent, as shown below:
Reimplement the insert anddelete methods in the BST classto update the parent for each node in the tree. Add the followingnew method in BST:
/** Returns the node for the specified element.
* Returns null if the element is not in the tree. */
private TreeNode<E> getNode(Eelement)
/** Returns true if the node for the element is a leaf */
private boolean isLeaf(E element)
/** Returns the path of elements from the specified element
* to the root in an array list. */
public ArrayList<E> getPath(E e)
Write a test program that prompts the user to enter 10 integers,adds them to the tree, deletes the first integer from the tree, anddisplays the paths for all leaf nodes. Here is a sample 2.
Create a program in Java.
- The program consists of four components: the Tree class, theLeaf class, the
Test class and graphical user interface (GUI).
- Test class is the main method. So, by console was a small menuwith three options:
add, delete and exit.
- If you click the add option, you will request for the name ofthe file you want to add and the name of the folder to whom youwant to add.
- If the name of the folder is equal to “null”, it is that thisfile will be a new root node and if it will not be comparing thename of the folder entered by keyboard with all the names of thenodes that are in the text document saved “read.txt” and when youfind it will insert the new file to that folder.
- If the option you click is to delete the program, it willrequest for the name of the folder to be delete it and it will becompare with each one of the file of the tree. If it correspondswith one of the nodes stored in the text document, this introducednode will be eliminate it.
Create a file browser by showing root folders, subfolders andfile name.
1. Refresh the file browser when delete a file or folder
2. Refresh the file browser when creating a file or folder
3. Show all object (files and folders) and folder child’s
4. Allow to export the information tree to a single file as thisexample:
Hey guys i really need help with this one. i don’t even knowwhere to start