Assignment 5 Part 1: Using the Tree Memento

$30.00

Category: Tags: , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (4 votes)

Assignment 5
Part 1: Using the Tree Memento
Posted on Piazza:Resources  Assignments is a file TreeGUI.java which implements a
graphical user interface for the Binary Search Tree and DupTree. This program was demo-ed in
Lecture 19. When it is run, a GUI appears, using which one can perform the familiar operations such
as insert, delete, etc. The program draws the tree or duptree as illustrated below.
Your task in this part of the assignment is to implement the actionPerformed method
corresponding to the Undo button. Implement this operation using the TreeMemento class given in
the file and discussed in Lecture 19. Using the Undo button, it should be possible to undo all
operations and restore earlier tree (or duptree) structures. The Undo button should never throw an
exception; instead, whenever it is inapplicable (e.g., trying to perform an undo before any tree is
built), a suitable pop-up message should be shown.
Coding Hints. The definition of the actionPerformed method is about 10-12 lines of Java code, and
it is similar to those of insert and delete (given in the file). Feel free to add extra class fields as
well as extra executable code to the TreeGUI class in order to support the Undo operation.
What to Submit. Prepare a top-level directory named A5_Part1_UBITId1_UBITId2 if the assignment is
done by a team of two students; otherwise, name it as A5_Part1_UBITId if the assignment is done
solo. (Order the UBITIds in alphabetic order, in the former case.) In this directory, place your revised
TreeGUI.java. Compress the directory and submit the compressed file using the submit_cse522
command. Only one submission per team is required.
Part 2: JUnit and Design by Contract
To Be Assigned.
End of Assignment 5 – Part 1