Due: Monday 4/15 10:00am
Submission name: New GH Classroom Link
Read the instructions in the code and write the requested code.
Addition for Friday 4/12
Add the ability to remove nodes with a mouse right-click with the following:
- Tree class
- New wrapper method: void
removeNode(TreeNode target)
- Call
removeNode(target, root)
, do not allowtarget
to be equal toroot
.
- Call
- New recursive method:
void removeNode(TreeNode target, TreeNode current)
- Remove
target
from the tree.current
starts atroot
(see wrapper method above), and traverses untiltarget
can be removed.
- Remove
- New wrapper method: void
- Driver File
mouseButton
is a variable similar tokey
. It will returnLEFT
orRIGHT
depending on which mouse button is being pressed. ModifymousePressed
so thatLEFT
will add a node below the selected node, andRIGHT
will remove the selected node.