Question: Write in java the driver class including (main method) implementing three classes below. Don't build the three classes below IF there is no need to.
Write in java the driver class including (main method) implementing three classes below.
Don't build the three classes below IF there is no need to. I just want the driver class with main method
a.Type 1 is a singly-linked list, no tail reference, non-circular, containing Integers.
b.Type 2 is a doubly-linked list with a tail reference, non-circular, containing Doubles.
c.Type 3 is a singly-linked circular list, your choice of a tail reference or not, (whichever will favor the operations) containing Strings. State in your cover letter whether you are using a tail reference and why you decided to go that way (it should be related to its usefulness for the operations).
The driver class (containing the main method) will handle user input. It will have three variables (objects), one for each list type.
Input will be from a user. You may assume a perfect user (i.e., you dont need to handle any errors). They will make menu choices (ints) and enter list data.
Output will be the current list (possibly changed by an operation) and, sometimes, messages (the result of an operation; for example, checking whether the list is sorted, or an error if they ask to insert in a non-ordered list).
The program will allow a user to, first, choose which of the three types of list to use, then, second, what operation they wish to run on one of those lists. Use simple text output for displaying the menus and getting user input.
Also here is the general list operations. All lists will provide the following operations:
a.build the list (allow any list size) from user input, in the order the data is entered
b.print the list, showing the head (and possibly tail); all will look like they are singly linked, but will be annotated with the appropriate words:
singly-linked, non-circular, tail:
head > 17 > 23 >19 < tail (singly-linked)
doubly-linked, non-circular, no tail:
head > 17 > 23 > 19 (doubly-linked)
singly-linked, circularly-linked, no tail:
head > cat > dog > puppy (singly-linked, circular)
empty lists:
head > null
head > null < tail
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
