Answer the given question with a proper explanation and step-by-step solution. Write in Java: Write a menu-driven program to illustrate the use of a linked list. The entries will only consist of integer number keys (values). The program should implement the following options in order: • Insert- insert a key into a list- not allowing duplicate integers. • Delete- delete a key from the list. • Search- finds or does not find a particular key in the list. • Print- prints the list graphically in horizontal form. If the list is empty output- "Nothing to print". • Size- count of all the keys in the list. • Sort- sorts the keys in the list in ascending order. • Reverse- reverses the order of the keys in the list • Rotate- moves the key at the front of the list to the end of the list. If the list has 0 or 1 elements it should have no effect on the list. • Shift- rearranges the keys of a list by moving to the end of the list all values that are in odd number positions (indexes) and otherwise preserving list order. • Clear - delete all the keys from the list. Output "Empty List". • Quit- Quit the program.
Answer the given question with a proper explanation and step-by-step solution.
Write in Java:
Write a menu-driven program to illustrate the use of a linked list. The entries will only consist of integer number keys (values). The program should implement the following options in order:
• Insert- insert a key into a list- not allowing duplicate integers.
• Delete- delete a key from the list.
• Search- finds or does not find a particular key in the list.
• Print- prints the list graphically in horizontal form. If the list is empty output- "Nothing to print".
• Size- count of all the keys in the list.
• Sort- sorts the keys in the list in ascending order.
• Reverse- reverses the order of the keys in the list
• Rotate- moves the key at the front of the list to the end of the list. If the list has 0 or 1 elements it should have no effect on the list.
• Shift- rearranges the keys of a list by moving to the end of the list all values that are in odd number positions (indexes) and otherwise preserving list order.
• Clear - delete all the keys from the list. Output "Empty List".
• Quit- Quit the program.
![The print list option should consist of a data field which is an integer and pointer to the next node. It
should look similar to below:
|
| 5 |
INT
6\
Error check all menu inputs. A linked list data structure must be used. Output should be user friendly.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F15d7109e-469c-48b5-b6f5-906596388e95%2F0525dca4-390d-435c-9e18-271e0f3731c8%2Fghl4hhc_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)