Question: Create a class called WordNode which has fields for the data (a Word) and next (WordNode) instance variables. Include a one-argument constructor which takes a

Create a class called WordNode which has fields for the data (a Word) and next (WordNode) instance variables. Include a one-argument constructor which takes a Word as a parameter. (For hints, see the PowerPoint on "Static vs. Dynamic Structures.) public WordNode (Word w) { . . } The instance variables should have private access. There will not be any get and set methods for the two instance variables. Create linked list class called WordList. This should be a linked list with head node as described in lecture. Modify it so that the data type in the nodes is Word. The no-argument constructor should create an empty list with first and last pointing to an empty head node, and length equal to zero. Include two methods in class WordList: append and insert. The append method will add the new node to the end of the list; the insert method will add the node in the proper position to keep the list sorted in order by Word. Instantiate two linked lists, and for every Word read from the file, add it (if it is three letters) to the first list using append, and to the second list using insert. You will end up with the first list having the Words from the input file in the order they were read, and in the second list the Words will be in sorted order. Display the unsorted and sorted Words in the GUI.

It should include :

Project2.java

Word.java

WordGUI.java

WordNode.java

WordList.java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!