SlideShare a Scribd company logo
1 of 3
JAVA please
How do we implement a circular array
Create an array of size 10 and fill it with numbers from 1 to 10
//ToDo
insert values in the array T from 1 to 3214 in a circular way beginning from index 0.
//ToDo
what is the content of the array T ?
//ToDo
Queue based Array implementation 1. The abstract data type Queue
//ToDo
2. The Queue class
import java.lang.reflect.Array;
public class Queue implements QueueADT{
private int size, front, rear;
private E data[];
public Queue(Class element,int size)
{
//ToDo
}
public boolean isEmpty(){
//ToDo
}
private boolean full()
{
//ToDo
}
public void enqueue(E x){
//ToDo
}
public E dequeue(){
//ToDo
} }
3. Testing
Queue Q = new Queue<>(Integer.class,9);
System.out.println(Q.isEmpty());
for(int i=1; i<9; i++)
{ Q.enqueue(i);
if(i%3==0)
Q.dequeue();
}
while(!Q.isEmpty())
{
System.out.println(Q.dequeue());
}
The output should be:
//ToDo
4. Reverse a queue
How to reverse the content of a queue using a stack
Queue Q = new Queue<>(Integer.class,9);
Stack S = new Stack<>();
for(int i=1; i<=9; i++){ Q.enqueue(i);
}
//Reversing the queue
//ToDo

More Related Content

Similar to JAVA please How do we implement a circular array Create an array of si.docx

Mixing Functional and Object Oriented Approaches to Programming in C#
Mixing Functional and Object Oriented Approaches to Programming in C#Mixing Functional and Object Oriented Approaches to Programming in C#
Mixing Functional and Object Oriented Approaches to Programming in C#Skills Matter
 
Please add-modify the following to the original code using C# 1- Delet.docx
Please add-modify the following to the original code using C# 1- Delet.docxPlease add-modify the following to the original code using C# 1- Delet.docx
Please add-modify the following to the original code using C# 1- Delet.docxStewartt0kJohnstonh
 
Conceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a ObjetosConceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a Objetosguest22a621
 
Mixing functional programming approaches in an object oriented language
Mixing functional programming approaches in an object oriented languageMixing functional programming approaches in an object oriented language
Mixing functional programming approaches in an object oriented languageMark Needham
 
Array assignment
Array assignmentArray assignment
Array assignmentAhmad Kamal
 
1z0 804 exam-java se 7 programmer ii
1z0 804 exam-java se 7 programmer ii1z0 804 exam-java se 7 programmer ii
1z0 804 exam-java se 7 programmer iiIsabella789
 
Visual Programing basic lectures 7.pptx
Visual Programing basic lectures  7.pptxVisual Programing basic lectures  7.pptx
Visual Programing basic lectures 7.pptxMrhaider4
 
Unit-2.Arrays and Strings.pptx.................
Unit-2.Arrays and Strings.pptx.................Unit-2.Arrays and Strings.pptx.................
Unit-2.Arrays and Strings.pptx.................suchitrapoojari984
 
Array 31.8.2020 updated
Array 31.8.2020 updatedArray 31.8.2020 updated
Array 31.8.2020 updatedvrgokila
 
Simulado java se 7 programmer
Simulado java se 7 programmerSimulado java se 7 programmer
Simulado java se 7 programmerMiguel Vilaca
 
Generics in .NET, C++ and Java
Generics in .NET, C++ and JavaGenerics in .NET, C++ and Java
Generics in .NET, C++ and JavaSasha Goldshtein
 
Java Generics
Java GenericsJava Generics
Java Genericsjeslie
 

Similar to JAVA please How do we implement a circular array Create an array of si.docx (20)

Mixing Functional and Object Oriented Approaches to Programming in C#
Mixing Functional and Object Oriented Approaches to Programming in C#Mixing Functional and Object Oriented Approaches to Programming in C#
Mixing Functional and Object Oriented Approaches to Programming in C#
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
Please add-modify the following to the original code using C# 1- Delet.docx
Please add-modify the following to the original code using C# 1- Delet.docxPlease add-modify the following to the original code using C# 1- Delet.docx
Please add-modify the following to the original code using C# 1- Delet.docx
 
White box-sol
White box-solWhite box-sol
White box-sol
 
Conceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a ObjetosConceitos Fundamentais de Orientação a Objetos
Conceitos Fundamentais de Orientação a Objetos
 
Questões de Certificação SCJP
Questões de Certificação SCJPQuestões de Certificação SCJP
Questões de Certificação SCJP
 
Java 5 Features
Java 5 FeaturesJava 5 Features
Java 5 Features
 
Mixing functional programming approaches in an object oriented language
Mixing functional programming approaches in an object oriented languageMixing functional programming approaches in an object oriented language
Mixing functional programming approaches in an object oriented language
 
Array assignment
Array assignmentArray assignment
Array assignment
 
1z0 804 exam-java se 7 programmer ii
1z0 804 exam-java se 7 programmer ii1z0 804 exam-java se 7 programmer ii
1z0 804 exam-java se 7 programmer ii
 
Oop objects_classes
Oop objects_classesOop objects_classes
Oop objects_classes
 
Visual Programing basic lectures 7.pptx
Visual Programing basic lectures  7.pptxVisual Programing basic lectures  7.pptx
Visual Programing basic lectures 7.pptx
 
CP Handout#9
CP Handout#9CP Handout#9
CP Handout#9
 
Unit-2.Arrays and Strings.pptx.................
Unit-2.Arrays and Strings.pptx.................Unit-2.Arrays and Strings.pptx.................
Unit-2.Arrays and Strings.pptx.................
 
Array 31.8.2020 updated
Array 31.8.2020 updatedArray 31.8.2020 updated
Array 31.8.2020 updated
 
C++11 - STL Additions
C++11 - STL AdditionsC++11 - STL Additions
C++11 - STL Additions
 
Simulado java se 7 programmer
Simulado java se 7 programmerSimulado java se 7 programmer
Simulado java se 7 programmer
 
Generics in .NET, C++ and Java
Generics in .NET, C++ and JavaGenerics in .NET, C++ and Java
Generics in .NET, C++ and Java
 
Java Generics
Java GenericsJava Generics
Java Generics
 

More from lucilabevin

JKCorp- was listed in the US- sock marke- and isued lever 2 ADR- Whot.docx
JKCorp- was listed in the US- sock marke- and isued lever 2 ADR- Whot.docxJKCorp- was listed in the US- sock marke- and isued lever 2 ADR- Whot.docx
JKCorp- was listed in the US- sock marke- and isued lever 2 ADR- Whot.docxlucilabevin
 
Jeffrey has a company with 100 employees- Over the past quarter he has.docx
Jeffrey has a company with 100 employees- Over the past quarter he has.docxJeffrey has a company with 100 employees- Over the past quarter he has.docx
Jeffrey has a company with 100 employees- Over the past quarter he has.docxlucilabevin
 
JCL Inc- is a major chip manufacturing firm that sells its products to (3).docx
JCL Inc- is a major chip manufacturing firm that sells its products to (3).docxJCL Inc- is a major chip manufacturing firm that sells its products to (3).docx
JCL Inc- is a major chip manufacturing firm that sells its products to (3).docxlucilabevin
 
Java-Data structure Write a method that reverses the order of elemen.docx
Java-Data structure   Write a method that reverses the order of elemen.docxJava-Data structure   Write a method that reverses the order of elemen.docx
Java-Data structure Write a method that reverses the order of elemen.docxlucilabevin
 
java Implement an algorithm to find the nth to the last element of a s.docx
java Implement an algorithm to find the nth to the last element of a s.docxjava Implement an algorithm to find the nth to the last element of a s.docx
java Implement an algorithm to find the nth to the last element of a s.docxlucilabevin
 
Jarrod became the father of triplets on June 20- On what date is he.docx
Jarrod became the father of triplets on June 20-   On what date is he.docxJarrod became the father of triplets on June 20-   On what date is he.docx
Jarrod became the father of triplets on June 20- On what date is he.docxlucilabevin
 
Janelle is a sixth-grade student who experiences hearing loss- When Ja.docx
Janelle is a sixth-grade student who experiences hearing loss- When Ja.docxJanelle is a sixth-grade student who experiences hearing loss- When Ja.docx
Janelle is a sixth-grade student who experiences hearing loss- When Ja.docxlucilabevin
 
Jane- who is married to Stuart- and Betty- a divorced single parent- h.docx
Jane- who is married to Stuart- and Betty- a divorced single parent- h.docxJane- who is married to Stuart- and Betty- a divorced single parent- h.docx
Jane- who is married to Stuart- and Betty- a divorced single parent- h.docxlucilabevin
 
It is the responsibility of the stakeholders to identify themselves to.docx
It is the responsibility of the stakeholders to identify themselves to.docxIt is the responsibility of the stakeholders to identify themselves to.docx
It is the responsibility of the stakeholders to identify themselves to.docxlucilabevin
 
Isabei Briggs Myers was a pioneer in the study of personality types- T.docx
Isabei Briggs Myers was a pioneer in the study of personality types- T.docxIsabei Briggs Myers was a pioneer in the study of personality types- T.docx
Isabei Briggs Myers was a pioneer in the study of personality types- T.docxlucilabevin
 
Issue Materiality is to Sustainability Materiality as Stakeholder Mana.docx
Issue Materiality is to Sustainability Materiality as Stakeholder Mana.docxIssue Materiality is to Sustainability Materiality as Stakeholder Mana.docx
Issue Materiality is to Sustainability Materiality as Stakeholder Mana.docxlucilabevin
 
Inflammatory bowel disease (IBD) is an autoimmune disorder impacting t.docx
Inflammatory bowel disease (IBD) is an autoimmune disorder impacting t.docxInflammatory bowel disease (IBD) is an autoimmune disorder impacting t.docx
Inflammatory bowel disease (IBD) is an autoimmune disorder impacting t.docxlucilabevin
 
is often used for interaction structure prediction)- Questions for Dis.docx
is often used for interaction structure prediction)- Questions for Dis.docxis often used for interaction structure prediction)- Questions for Dis.docx
is often used for interaction structure prediction)- Questions for Dis.docxlucilabevin
 
Ip Task- Study- mor rests e car for en ogroed pobiod oi The bemaked on.docx
Ip Task- Study- mor rests e car for en ogroed pobiod oi The bemaked on.docxIp Task- Study- mor rests e car for en ogroed pobiod oi The bemaked on.docx
Ip Task- Study- mor rests e car for en ogroed pobiod oi The bemaked on.docxlucilabevin
 
Introduction- Take this quiz to get a quick check on your understandin.docx
Introduction- Take this quiz to get a quick check on your understandin.docxIntroduction- Take this quiz to get a quick check on your understandin.docx
Introduction- Take this quiz to get a quick check on your understandin.docxlucilabevin
 
Introduction to Minerals and Rocks A large segment of geology is the s.docx
Introduction to Minerals and Rocks A large segment of geology is the s.docxIntroduction to Minerals and Rocks A large segment of geology is the s.docx
Introduction to Minerals and Rocks A large segment of geology is the s.docxlucilabevin
 
Introduction to Pest Biology Lab Manual- Try to complete this matching.docx
Introduction to Pest Biology Lab Manual- Try to complete this matching.docxIntroduction to Pest Biology Lab Manual- Try to complete this matching.docx
Introduction to Pest Biology Lab Manual- Try to complete this matching.docxlucilabevin
 
In which organisms a part of the genetic code has alternative reading-.docx
In which organisms a part of the genetic code has alternative reading-.docxIn which organisms a part of the genetic code has alternative reading-.docx
In which organisms a part of the genetic code has alternative reading-.docxlucilabevin
 
intermediate accounting II CH 14 Question 1- Early extinguishment of d.docx
intermediate accounting II CH 14 Question 1- Early extinguishment of d.docxintermediate accounting II CH 14 Question 1- Early extinguishment of d.docx
intermediate accounting II CH 14 Question 1- Early extinguishment of d.docxlucilabevin
 
Interest rate (-)Quantity of loanable funds.docx
Interest rate (-)Quantity of loanable funds.docxInterest rate (-)Quantity of loanable funds.docx
Interest rate (-)Quantity of loanable funds.docxlucilabevin
 

More from lucilabevin (20)

JKCorp- was listed in the US- sock marke- and isued lever 2 ADR- Whot.docx
JKCorp- was listed in the US- sock marke- and isued lever 2 ADR- Whot.docxJKCorp- was listed in the US- sock marke- and isued lever 2 ADR- Whot.docx
JKCorp- was listed in the US- sock marke- and isued lever 2 ADR- Whot.docx
 
Jeffrey has a company with 100 employees- Over the past quarter he has.docx
Jeffrey has a company with 100 employees- Over the past quarter he has.docxJeffrey has a company with 100 employees- Over the past quarter he has.docx
Jeffrey has a company with 100 employees- Over the past quarter he has.docx
 
JCL Inc- is a major chip manufacturing firm that sells its products to (3).docx
JCL Inc- is a major chip manufacturing firm that sells its products to (3).docxJCL Inc- is a major chip manufacturing firm that sells its products to (3).docx
JCL Inc- is a major chip manufacturing firm that sells its products to (3).docx
 
Java-Data structure Write a method that reverses the order of elemen.docx
Java-Data structure   Write a method that reverses the order of elemen.docxJava-Data structure   Write a method that reverses the order of elemen.docx
Java-Data structure Write a method that reverses the order of elemen.docx
 
java Implement an algorithm to find the nth to the last element of a s.docx
java Implement an algorithm to find the nth to the last element of a s.docxjava Implement an algorithm to find the nth to the last element of a s.docx
java Implement an algorithm to find the nth to the last element of a s.docx
 
Jarrod became the father of triplets on June 20- On what date is he.docx
Jarrod became the father of triplets on June 20-   On what date is he.docxJarrod became the father of triplets on June 20-   On what date is he.docx
Jarrod became the father of triplets on June 20- On what date is he.docx
 
Janelle is a sixth-grade student who experiences hearing loss- When Ja.docx
Janelle is a sixth-grade student who experiences hearing loss- When Ja.docxJanelle is a sixth-grade student who experiences hearing loss- When Ja.docx
Janelle is a sixth-grade student who experiences hearing loss- When Ja.docx
 
Jane- who is married to Stuart- and Betty- a divorced single parent- h.docx
Jane- who is married to Stuart- and Betty- a divorced single parent- h.docxJane- who is married to Stuart- and Betty- a divorced single parent- h.docx
Jane- who is married to Stuart- and Betty- a divorced single parent- h.docx
 
It is the responsibility of the stakeholders to identify themselves to.docx
It is the responsibility of the stakeholders to identify themselves to.docxIt is the responsibility of the stakeholders to identify themselves to.docx
It is the responsibility of the stakeholders to identify themselves to.docx
 
Isabei Briggs Myers was a pioneer in the study of personality types- T.docx
Isabei Briggs Myers was a pioneer in the study of personality types- T.docxIsabei Briggs Myers was a pioneer in the study of personality types- T.docx
Isabei Briggs Myers was a pioneer in the study of personality types- T.docx
 
Issue Materiality is to Sustainability Materiality as Stakeholder Mana.docx
Issue Materiality is to Sustainability Materiality as Stakeholder Mana.docxIssue Materiality is to Sustainability Materiality as Stakeholder Mana.docx
Issue Materiality is to Sustainability Materiality as Stakeholder Mana.docx
 
Inflammatory bowel disease (IBD) is an autoimmune disorder impacting t.docx
Inflammatory bowel disease (IBD) is an autoimmune disorder impacting t.docxInflammatory bowel disease (IBD) is an autoimmune disorder impacting t.docx
Inflammatory bowel disease (IBD) is an autoimmune disorder impacting t.docx
 
is often used for interaction structure prediction)- Questions for Dis.docx
is often used for interaction structure prediction)- Questions for Dis.docxis often used for interaction structure prediction)- Questions for Dis.docx
is often used for interaction structure prediction)- Questions for Dis.docx
 
Ip Task- Study- mor rests e car for en ogroed pobiod oi The bemaked on.docx
Ip Task- Study- mor rests e car for en ogroed pobiod oi The bemaked on.docxIp Task- Study- mor rests e car for en ogroed pobiod oi The bemaked on.docx
Ip Task- Study- mor rests e car for en ogroed pobiod oi The bemaked on.docx
 
Introduction- Take this quiz to get a quick check on your understandin.docx
Introduction- Take this quiz to get a quick check on your understandin.docxIntroduction- Take this quiz to get a quick check on your understandin.docx
Introduction- Take this quiz to get a quick check on your understandin.docx
 
Introduction to Minerals and Rocks A large segment of geology is the s.docx
Introduction to Minerals and Rocks A large segment of geology is the s.docxIntroduction to Minerals and Rocks A large segment of geology is the s.docx
Introduction to Minerals and Rocks A large segment of geology is the s.docx
 
Introduction to Pest Biology Lab Manual- Try to complete this matching.docx
Introduction to Pest Biology Lab Manual- Try to complete this matching.docxIntroduction to Pest Biology Lab Manual- Try to complete this matching.docx
Introduction to Pest Biology Lab Manual- Try to complete this matching.docx
 
In which organisms a part of the genetic code has alternative reading-.docx
In which organisms a part of the genetic code has alternative reading-.docxIn which organisms a part of the genetic code has alternative reading-.docx
In which organisms a part of the genetic code has alternative reading-.docx
 
intermediate accounting II CH 14 Question 1- Early extinguishment of d.docx
intermediate accounting II CH 14 Question 1- Early extinguishment of d.docxintermediate accounting II CH 14 Question 1- Early extinguishment of d.docx
intermediate accounting II CH 14 Question 1- Early extinguishment of d.docx
 
Interest rate (-)Quantity of loanable funds.docx
Interest rate (-)Quantity of loanable funds.docxInterest rate (-)Quantity of loanable funds.docx
Interest rate (-)Quantity of loanable funds.docx
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

JAVA please How do we implement a circular array Create an array of si.docx

  • 1. JAVA please How do we implement a circular array Create an array of size 10 and fill it with numbers from 1 to 10 //ToDo insert values in the array T from 1 to 3214 in a circular way beginning from index 0. //ToDo what is the content of the array T ? //ToDo Queue based Array implementation 1. The abstract data type Queue //ToDo 2. The Queue class import java.lang.reflect.Array; public class Queue implements QueueADT{ private int size, front, rear; private E data[]; public Queue(Class element,int size) { //ToDo } public boolean isEmpty(){ //ToDo } private boolean full()
  • 2. { //ToDo } public void enqueue(E x){ //ToDo } public E dequeue(){ //ToDo } } 3. Testing Queue Q = new Queue<>(Integer.class,9); System.out.println(Q.isEmpty()); for(int i=1; i<9; i++) { Q.enqueue(i); if(i%3==0) Q.dequeue(); } while(!Q.isEmpty()) { System.out.println(Q.dequeue()); } The output should be: //ToDo
  • 3. 4. Reverse a queue How to reverse the content of a queue using a stack Queue Q = new Queue<>(Integer.class,9); Stack S = new Stack<>(); for(int i=1; i<=9; i++){ Q.enqueue(i); } //Reversing the queue //ToDo