WRITE JAVA CODE TO THE GIVEN CODE BELOW JUST FOR THE "FILL HERE " PARTS!!! USE THE PHOTO FOR THE MAIN CLASS, JUST RESULTS ARE WRITTEN THERE public class Queue {   private T[] a = /* fill here */;   private int N = 0;     public /* fill here */ isEmpty() {     // ... fille here ...   }     public /* fill here */ size() {     // ... fille here ...   }     private /* fill here */ resize(/* fill here if needed*/) {      // ... fille here ...   }     public /* fill here */ enqueue(/* fill here if needed*/) {      // ... fille here ...   }     public /* fill here */ dequeue(/* fill here if needed*/) {       // ... fille here ...   }     // this method is for unit testing; don't touch   public int getArraySize(){    return a.length;  } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

WRITE JAVA CODE TO THE GIVEN CODE BELOW JUST FOR THE "FILL HERE " PARTS!!!

USE THE PHOTO FOR THE MAIN CLASS, JUST RESULTS ARE WRITTEN THERE

public class Queue<T> {

  private T[] a = /* fill here */;

  private int N = 0;

 

  public /* fill here */ isEmpty() {

    // ... fille here ...

  }

 

  public /* fill here */ size() {

    // ... fille here ...

  }

 

  private /* fill here */ resize(/* fill here if needed*/) { 

    // ... fille here ...

  }

 

  public /* fill here */ enqueue(/* fill here if needed*/) { 

    // ... fille here ...

  }

 

  public /* fill here */ dequeue(/* fill here if needed*/) {  

    // ... fille here ...

  }

 

  // this method is for unit testing; don't touch

  public int getArraySize(){    return a.length;  }

}

Eclipse File Edit Source Refactor Navigate Search Project Run Window
eclipse-workspace - NewChallangeOf211/src/Mian.java - Eclipse IDE
Project Explorer X
>
Cmpe211Final
Cmpe211Midterm Prep
Cmpe261MidtermPrep
Cmpehw
CS
Cweek10
GETREADY
Homework2
Homework3
Homework4
Homeworks
Lec03-01
MyFinal
MYTRIES
NEW
NewChallange Of211
> JRE System Library [Java SE-15]
src
010
(default package)
BubbleSort.java
>
> InsertingSort.java
>
>
>
>
Insertion.java
labExercise.java
>
>
>
>
> MergeForIntegers.java
>
>
Line.java
Main.java
MergeSort.java
Mian.java
> MinMaxAvgClass.java
> Point.java
>
New Connection...
Queue.java
Queue1.java
QuickSort.java
Selection.java
Trying.java
Queue.java
NOW
> JRE System Library [JavaSE-15]
src
Referenced Libraries
StudentQuiz....
class Main
$10
11
12
13
14
x15
16
x17
18
x19
20
21
22
23
24
25
x26
27
28
29
30
x31
32
33
34
35
x36
x37
38
x39
40
41
42
x43
44
2
3
45
46
47 }
AverageOfCol...
public static void main(String[] args) {
Queue<Integer> myQueue = new Queue<Integer>();
int i;
i = 1;
InsertingSo...
myQueue.enqueue(i); System.out.printf("myQueue.enqueue (%d); \n", i);
i = 2;
myQueue.enqueue (i); System.out.printf("myQueue.enqueue (%d); \n", i);
i = 3;
myQueue.enqueue (i); System.out.printf("myQueue. enqueue (%d); \n", i);
i = 4;
myQueue.enqueue (i);
System.out.printf("myQueue. enqueue (%d); \n", i);
i = 5;
myQueue.enqueue (i); System.out.printf("myQueue.enqueue (%d); \n", i);
int x = myQueue.dequeue ();
System.out.printf("myQueue.dequeue () gives back %d;\n",x);
x = myQueue.dequeue();
System.out.printf("myQueue.dequeue () gives back %d; \n",x);
x = myQueue.dequeue ();
System.out.printf("myQueue.dequeue () gives back %d;\n",x);
i = 6;
myQueue.enqueue (i); System.out.printf("myQueue.enqueue (%d); \n", i);
i = 7;
myQueue.enqueue(i); System.out.printf("myQueue.enqueue (%d); \n", i);
i = 8;
myQueue.enqueue (i); System.out.printf("myQueue. enqueue (%d); \n", i);
x = myQueue.dequeue ();
System.out.printf("myQueue. dequeue () gives back %d;\n",x);
x = myQueue.dequeue ();
System.out.printf("myQueue.dequeue
() gives back %d;\n",x);
x = myQueue.dequeue ();
System.out.printf("myQueue.dequeue () gives back %d; \n",x);
i = 9;
myQueue.enqueue (i); System.out.printf("myQueue. enqueue (%d);\n",i);
i = 10;
myQueue.enqueue (i); System.out.printf("myQueue.enqueue (%d); \n", i);
Help
Selection.java
x = myQueue.dequeue ();
System.out.printf("myQueue.dequeue () gives back %d;\n",x);
x = myQueue.dequeue ();
System.out.printf("myQueue.dequeue
() gives back %d;\n",x);
x = myQueue.dequeue();
System.out.printf("myQueue.dequeue
() gives back %d;\n",x);
x = myQueue.dequeue ();
System.out.printf("myQueue.dequeue () gives back %d;\n",x);
JAN
3
OOO
Writable
Insertion.java J*Mian.java X *Queue.java
Console X
<terminated> Insertion [Java Application] /Users/kivancdemirkiran/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.x86_64_15.0.2.v20210201-0955/jre/bin/java (Jan 3, 2023, 12:35:01 PM – 12:35:01 PM)
Smart Insert
tv
48: 2:1990
2
A
Queue1.java
W
EPIC
GAMES
W
Main.java
ad
AN
3 January Tue 15:08
t
90
U
51
AU
Transcribed Image Text:Eclipse File Edit Source Refactor Navigate Search Project Run Window eclipse-workspace - NewChallangeOf211/src/Mian.java - Eclipse IDE Project Explorer X > Cmpe211Final Cmpe211Midterm Prep Cmpe261MidtermPrep Cmpehw CS Cweek10 GETREADY Homework2 Homework3 Homework4 Homeworks Lec03-01 MyFinal MYTRIES NEW NewChallange Of211 > JRE System Library [Java SE-15] src 010 (default package) BubbleSort.java > > InsertingSort.java > > > > Insertion.java labExercise.java > > > > > MergeForIntegers.java > > Line.java Main.java MergeSort.java Mian.java > MinMaxAvgClass.java > Point.java > New Connection... Queue.java Queue1.java QuickSort.java Selection.java Trying.java Queue.java NOW > JRE System Library [JavaSE-15] src Referenced Libraries StudentQuiz.... class Main $10 11 12 13 14 x15 16 x17 18 x19 20 21 22 23 24 25 x26 27 28 29 30 x31 32 33 34 35 x36 x37 38 x39 40 41 42 x43 44 2 3 45 46 47 } AverageOfCol... public static void main(String[] args) { Queue<Integer> myQueue = new Queue<Integer>(); int i; i = 1; InsertingSo... myQueue.enqueue(i); System.out.printf("myQueue.enqueue (%d); \n", i); i = 2; myQueue.enqueue (i); System.out.printf("myQueue.enqueue (%d); \n", i); i = 3; myQueue.enqueue (i); System.out.printf("myQueue. enqueue (%d); \n", i); i = 4; myQueue.enqueue (i); System.out.printf("myQueue. enqueue (%d); \n", i); i = 5; myQueue.enqueue (i); System.out.printf("myQueue.enqueue (%d); \n", i); int x = myQueue.dequeue (); System.out.printf("myQueue.dequeue () gives back %d;\n",x); x = myQueue.dequeue(); System.out.printf("myQueue.dequeue () gives back %d; \n",x); x = myQueue.dequeue (); System.out.printf("myQueue.dequeue () gives back %d;\n",x); i = 6; myQueue.enqueue (i); System.out.printf("myQueue.enqueue (%d); \n", i); i = 7; myQueue.enqueue(i); System.out.printf("myQueue.enqueue (%d); \n", i); i = 8; myQueue.enqueue (i); System.out.printf("myQueue. enqueue (%d); \n", i); x = myQueue.dequeue (); System.out.printf("myQueue. dequeue () gives back %d;\n",x); x = myQueue.dequeue (); System.out.printf("myQueue.dequeue () gives back %d;\n",x); x = myQueue.dequeue (); System.out.printf("myQueue.dequeue () gives back %d; \n",x); i = 9; myQueue.enqueue (i); System.out.printf("myQueue. enqueue (%d);\n",i); i = 10; myQueue.enqueue (i); System.out.printf("myQueue.enqueue (%d); \n", i); Help Selection.java x = myQueue.dequeue (); System.out.printf("myQueue.dequeue () gives back %d;\n",x); x = myQueue.dequeue (); System.out.printf("myQueue.dequeue () gives back %d;\n",x); x = myQueue.dequeue(); System.out.printf("myQueue.dequeue () gives back %d;\n",x); x = myQueue.dequeue (); System.out.printf("myQueue.dequeue () gives back %d;\n",x); JAN 3 OOO Writable Insertion.java J*Mian.java X *Queue.java Console X <terminated> Insertion [Java Application] /Users/kivancdemirkiran/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.x86_64_15.0.2.v20210201-0955/jre/bin/java (Jan 3, 2023, 12:35:01 PM – 12:35:01 PM) Smart Insert tv 48: 2:1990 2 A Queue1.java W EPIC GAMES W Main.java ad AN 3 January Tue 15:08 t 90 U 51 AU
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Adjacency Matrix
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education