Question: This project creates a custom linked list structure. It serves as an exercise in working with linked lists and nodes. Overview: Suppose the names Bob,

 This project creates a custom linked list structure. It serves as
an exercise in working with linked lists and nodes. Overview: Suppose the

This project creates a custom linked list structure. It serves as an exercise in working with linked lists and nodes. Overview: Suppose the names "Bob", "Dan", and "Ben", are added, the result is: ----- --- D ----- head --> |--> Dan |-- ----- | B |--> ----- Ben ----- --> Bob | --> ----- If the names "Deb" and "Sarah" are added, it looks like this: - - - - -- - - - ----- | --> head --> Dan --> B Deb --> --> | Ben S --> Bob --> |-->Sarah -- D -- - - ----- If "Deb" and "Sarah" are deleted, the list should look like the first list again. Details: Create a Java class called NameList (not generic) that stores names and implements the structure shown above. Note that the names are kept in sorted order. Letter nodes are always uppercase. Lowercase names will follow uppercase names in normal sorted order. You may not use Java's LinkedList class. You should create your own nodes and link them together as shown in the illustration. Your class should support the following methods. 20 points add - Adds a new name. Names must be at least 2 characters long. Adds the letter node if not already present. 20 points remove - Removes a name. If the name is the last one for a letter, the letter node should also be removed. 20 points removeLetter - Removes a letter and all names for that letter. 20 points find - Finds a name by traversing the nodes. 10 points toString - Returns a string of the list formatted as shown below using the first list above as an example: Ben Bob Dan 10 points main - Demonstrates the methods of your NameList class

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!