Question
QUEUE - java, plz use simple java language, netbeans 8.1 or 8.2 1. Create a Queue class based on MyLinkedList class. Use this class in
QUEUE - java, plz use simple java language, netbeans 8.1 or 8.2
1. Create a Queue class based on MyLinkedList class. Use this class in the following:
2. Create a new Java Application that has the following methods:
1. A method to generate a number of elements between two given values and save them in a queue
2. A method to print a queue (10 elements per line). The original queue should remain as is after the print
3. A method to return the number of elements on the queue.
4. A method to return if the queue is empty or not.
5. A method to search for a value in a queue. The queue should remain the same after the search is finished.
6. A method to exchange the first element and the last element in a queue (a switch/swap).
7. A method to check if a queue is included in another queue (q1 is included in q2 if q1 is a sub-queue of q2). q1
and q2 should remain as they were originally.
8. A method peekLowestElement to return the smallest element. The original Queue should remain unchanged.
9. A method peekHighestElement to return the largest element. The original Queue should remain unchanged.
10. A method to inverse a queue.
11. A method to make a copy of a queue into a stack (the original queue should remain as is).
In the main method test all your methods including the following cases:
! Create 2 queues q1 and q2
! Insert 23 integers between 20 and 60 (do not insert duplicates) into q1.
! Insert 35 integers between 10 and 80 (do not insert duplicates) into q2.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started