SlideShare a Scribd company logo
output and explain why MyQueue.java public interface MyQueue { public boolean add(E item);
public E remove(); public E peek(); public boolean isEmpty(); } LinkedQueue.java import java.util.*;
public class LinkedQueue implements MyQueue{ private LinkedList list; public LinkedQueue() { list
= new LinkedList(); } public boolean add(E item) { list.addLast(item); return true; } public E
remove() { return list.removeFirst(); } public E peek() { return list.getFirst(); } public boolean
isEmpty() { return list.isEmpty(); } public static void main(String[] args) { MyQueue queue = new
LinkedQueue

More Related Content

More from abcchanbasha

Con tristeza los cuatro estudiantes de la Universidad Carne.pdf
Con tristeza los cuatro estudiantes de la Universidad Carne.pdfCon tristeza los cuatro estudiantes de la Universidad Carne.pdf
Con tristeza los cuatro estudiantes de la Universidad Carne.pdf
abcchanbasha
 
Gestin de recursos humanos en Rusia el dilema de un estado.pdf
Gestin de recursos humanos en Rusia el dilema de un estado.pdfGestin de recursos humanos en Rusia el dilema de un estado.pdf
Gestin de recursos humanos en Rusia el dilema de un estado.pdf
abcchanbasha
 
1 Cul de las siguientes afirmaciones sobre los efectos da.pdf
1 Cul de las siguientes afirmaciones sobre los efectos da.pdf1 Cul de las siguientes afirmaciones sobre los efectos da.pdf
1 Cul de las siguientes afirmaciones sobre los efectos da.pdf
abcchanbasha
 

More from abcchanbasha (20)

Con tristeza los cuatro estudiantes de la Universidad Carne.pdf
Con tristeza los cuatro estudiantes de la Universidad Carne.pdfCon tristeza los cuatro estudiantes de la Universidad Carne.pdf
Con tristeza los cuatro estudiantes de la Universidad Carne.pdf
 
Cmo ocurre la transformacin digital El caso de la tarje.pdf
Cmo ocurre la transformacin digital  El caso de la tarje.pdfCmo ocurre la transformacin digital  El caso de la tarje.pdf
Cmo ocurre la transformacin digital El caso de la tarje.pdf
 
In the above table P is the euro price of the asset held by.pdf
In the above table P is the euro price of the asset held by.pdfIn the above table P is the euro price of the asset held by.pdf
In the above table P is the euro price of the asset held by.pdf
 
Batten disease otherwise known as Neuronal Ceroid Lipofusci.pdf
Batten disease otherwise known as Neuronal Ceroid Lipofusci.pdfBatten disease otherwise known as Neuronal Ceroid Lipofusci.pdf
Batten disease otherwise known as Neuronal Ceroid Lipofusci.pdf
 
Globalisation is frequently hastened by removing regulatory .pdf
Globalisation is frequently hastened by removing regulatory .pdfGlobalisation is frequently hastened by removing regulatory .pdf
Globalisation is frequently hastened by removing regulatory .pdf
 
Gestin de recursos humanos en Rusia el dilema de un estado.pdf
Gestin de recursos humanos en Rusia el dilema de un estado.pdfGestin de recursos humanos en Rusia el dilema de un estado.pdf
Gestin de recursos humanos en Rusia el dilema de un estado.pdf
 
For each of the statements below please answer true or fals.pdf
For each of the statements below please answer true or fals.pdfFor each of the statements below please answer true or fals.pdf
For each of the statements below please answer true or fals.pdf
 
Find the zscores for which 50 of the distributions area l.pdf
Find the zscores for which 50 of the distributions area l.pdfFind the zscores for which 50 of the distributions area l.pdf
Find the zscores for which 50 of the distributions area l.pdf
 
5 Consider part of the STUDENT database where the enrollme.pdf
5 Consider part of the STUDENT database where the enrollme.pdf5 Consider part of the STUDENT database where the enrollme.pdf
5 Consider part of the STUDENT database where the enrollme.pdf
 
Consider a given itemset I1I2I4 The table below indicat.pdf
Consider a given itemset I1I2I4 The table below indicat.pdfConsider a given itemset I1I2I4 The table below indicat.pdf
Consider a given itemset I1I2I4 The table below indicat.pdf
 
A researcher is investigating the effect of background noise.pdf
A researcher is investigating the effect of background noise.pdfA researcher is investigating the effect of background noise.pdf
A researcher is investigating the effect of background noise.pdf
 
11 Requiron and excess reserves Suppose that Third fidelit.pdf
11 Requiron and excess reserves Suppose that Third fidelit.pdf11 Requiron and excess reserves Suppose that Third fidelit.pdf
11 Requiron and excess reserves Suppose that Third fidelit.pdf
 
begintabularllllll hline Metaboliccycle amp.pdf
begintabularllllll hline Metaboliccycle amp.pdfbegintabularllllll hline Metaboliccycle amp.pdf
begintabularllllll hline Metaboliccycle amp.pdf
 
1 For the following C statement please complete the corres.pdf
1 For the following C statement please complete the corres.pdf1 For the following C statement please complete the corres.pdf
1 For the following C statement please complete the corres.pdf
 
1 Insert the number of student N2 2 Insert the number .pdf
1 Insert the number of student N2 2 Insert the number .pdf1 Insert the number of student N2 2 Insert the number .pdf
1 Insert the number of student N2 2 Insert the number .pdf
 
1 Match each scientist listed below with their contribution.pdf
1 Match each scientist listed below with their contribution.pdf1 Match each scientist listed below with their contribution.pdf
1 Match each scientist listed below with their contribution.pdf
 
1 Vroom developed two decision trees to help managers decid.pdf
1 Vroom developed two decision trees to help managers decid.pdf1 Vroom developed two decision trees to help managers decid.pdf
1 Vroom developed two decision trees to help managers decid.pdf
 
1 Cul de las siguientes afirmaciones sobre los efectos da.pdf
1 Cul de las siguientes afirmaciones sobre los efectos da.pdf1 Cul de las siguientes afirmaciones sobre los efectos da.pdf
1 Cul de las siguientes afirmaciones sobre los efectos da.pdf
 
0 The average individual monthly spending in the United Sta.pdf
0 The average individual monthly spending in the United Sta.pdf0 The average individual monthly spending in the United Sta.pdf
0 The average individual monthly spending in the United Sta.pdf
 
La hiptesis del flujo de caja libre establece que O.pdf
    La hiptesis del flujo de caja libre establece que   O.pdf    La hiptesis del flujo de caja libre establece que   O.pdf
La hiptesis del flujo de caja libre establece que O.pdf
 

Recently uploaded

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
heathfieldcps1
 
ppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyes
ashishpaul799
 

Recently uploaded (20)

UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
Open Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPointOpen Educational Resources Primer PowerPoint
Open Educational Resources Primer PowerPoint
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17How to the fix Attribute Error in odoo 17
How to the fix Attribute Error in odoo 17
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17
 
Morse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptxMorse OER Some Benefits and Challenges.pptx
Morse OER Some Benefits and Challenges.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
ppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyes
 

output and explain why MyQueuejava public interface MyQueu.pdf

  • 1. output and explain why MyQueue.java public interface MyQueue { public boolean add(E item); public E remove(); public E peek(); public boolean isEmpty(); } LinkedQueue.java import java.util.*; public class LinkedQueue implements MyQueue{ private LinkedList list; public LinkedQueue() { list = new LinkedList(); } public boolean add(E item) { list.addLast(item); return true; } public E remove() { return list.removeFirst(); } public E peek() { return list.getFirst(); } public boolean isEmpty() { return list.isEmpty(); } public static void main(String[] args) { MyQueue queue = new LinkedQueue