Question: Programming Language: Java Create your own queue interface with the following method: add(element) this method is used to add elements at the tail of the
Programming Language: Java
- Create your own queue interface with the following method:
- add(element) this method is used to add elements at the tail of the queue.is method
- poll() this method removes and returns the head of the queue. It returns null if the queue is empty.
- peek() this method is used to view the head of the queue without removing it. It returns null if the queue is empty.
- isEmpty() this method returns true if queue is empty.
- size() this method returns the number of elements in the queue. Write also a program to implement your interface. Test all our method, Print screen the output, write a comment and make it neat.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
