Question: JAVA (DATA STRUCTURE) Add the following methods to the Linkedqueue class, and create a test driver for each to show that they work correctly. In

Add the following methods to the Linkedqueue class, and create a test driver for each to show that they work correctly. In order to practice your linked list coding skills, code each of these methods by accessing the internal variables of the Iinkedqueue, not by calling the previously defined public methods of the class. 1. string tostring () creates and returns a string that correctly represents the current queue. Such a method could prove useful for testing and debugging the class and for testing and debugging applications that use the class. Assume each queued element already provides its own reasonable tostring method. 2. void remove (int count) removes the front count elements from the queue; throws Queueunderflowexception if less than count elements are in the queue. 3. boolean swapstart () returns false if less than two elements are in the queue, otherwise reverses the order of the front two elements in the queue and returns txue. 4. boolean swapends () returns false if there are less than two elements in the queue, otherwise swaps the first and last elements of the queue and returns true. 7 package cho4.queues
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
