Due: Monday 4/15 10:00am

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 allow target to be equal to root.
    • New recursive method: void removeNode(TreeNode target, TreeNode current)
      • Remove target from the tree. current starts at root (see wrapper method above), and traverses until target can be removed.
  • Driver File
    • mouseButton is a variable similar to key. It will return LEFT or RIGHT depending on which mouse button is being pressed. Modify mousePressed so that LEFT will add a node below the selected node, and RIGHT will remove the selected node.