Question: Urgent! ( Parent reference for BST ) Redefine Tree Node by adding a reference to a nodes parent, as shown below: Reimplement the insert and
Urgent!
(Parent reference for BST) Redefine Tree Node by adding a reference to a nodes 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:
/** Returns the node for the specified element.
* Returns null if the element is not in the tree. */
private TreeNode
/** 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
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 2.
Create a program in Java.
- The program consists of four components: the Tree class, the Leaf class, the
Test class and graphical user interface (GUI).
- Test class is the main method. So, by console was a small menu with three options:
add, delete and exit.
- If you click the add option, you will request for the name of the file you want to add and the name of the folder to whom you want to add.
- If the name of the folder is equal to "null", it is that this file will be a new root node and if it will not be comparing the name of the folder entered by keyboard with all the names of the nodes that are in the text document saved "read.txt" and when you find it will insert the new file to that folder.
- If the option you click is to delete the program, it will request for the name of the folder to be delete it and it will be compare with each one of the file of the tree. If it corresponds with one of the nodes stored in the text document, this introduced node will be eliminate it.
Create a file browser by showing root folders, subfolders and file 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 childs
4. Allow to export the information tree to a single file as this example:
Folder
folder_1
file.txt
file_1.1.1
file_1.1.2
file_1.1.3
file_1.2
file_1.2.1
file_1.2.2
file_2.2
file_2.2.2
music
song1.mp3
song2.mp3
Hey guys i really need help with this one. i don't even know where to start
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
