Question: JAVA 1. Create a Queue and a Stack class whose element type is int. Name them Queue and Stack with the capacity of 10. 2.
JAVA
1. Create a Queue and a Stack class whose element type is int. Name them Queue and Stack with the capacity of 10.
2. Create a driver program to create a Queue (and Stack) object and add integer numbers from 1 to 11, and then remove them and print on screen the content of the Queue (and Stack) until the Queue (and Stack) is empty. Name the driver program Lab4.java. Do not throw an exception: check if full or empty and ignore adding on full and removing on empty Stack or Queue.
3. Add five elements (12, 13, 14, 15, 16) to the queue and then remove two elements, and show the position of front and rear of the queue.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
