Question: please create it as simple as possible java Lab 9: Queue (using Array) Objective(s) Types of Queue Queue operations Queue implementation using Array (Linear and

please create it as simple as possible
java  please create it as simple as possible java Lab 9: Queue
(using Array) Objective(s) Types of Queue Queue operations Queue implementation using Array
(Linear and Circular) Tool(s)/Software Java programming language with NetBeans IDE. Description Types
of Queue Linear Queue Circular Queue Double Ended Queue Priority Queue Queue
Main Operations: Enqueue - To insert an element in Queue (at the

Lab 9: Queue (using Array) Objective(s) Types of Queue Queue operations Queue implementation using Array (Linear and Circular) Tool(s)/Software Java programming language with NetBeans IDE. Description Types of Queue Linear Queue Circular Queue Double Ended Queue Priority Queue Queue Main Operations: Enqueue - To insert an element in Queue (at the rear of the queue) Dequeue - To delete an element from Queue (from the front of the queue) A. Linear Queue implementation using array (QueueArray.java): public class Queuskaray private int front - 0, rear -0. Die Dcount = 0; private int Queue QuesArray (int maxdize) Quebenew int [maxsize) this.size XSize: public boolean Empty seturn count - 0) public boolean isfullt) return countries public int getFront freturn Querant public int getReart) return Queres - 1171 public int getSize() { return conta public void Enquese tint value) olides public void De Queve().es public void display) ..10 Lines CS 310: Data Structure Page 1 Enqueue and Dequeue in Queue Array class: way.jave publie class Queundrray puble vosa Bunt value) (all System.out.println( rezoreturn; 1 Daun Systen.ct.printlntvalue+ - width System.out.printla return; 1 dystem.c. 23+ Dexted tre In the main, create object and try the queue operations: public static void main(String) arga) Oseunray new Querray (5) 0.Enoueue (10) 0. EnQueue (20) Q. En ese (30): Q.Enoueue (40) 0.Enquese (50) System.out.println("ine of Ouncet +0.getSize()); System.out.printin("Pront of Oat.getFront); System.out.printin("hear of Osede: 0.getRear(); 0.Dequese(); 9.DeQueue(); 0. De Quee(): Q. Engueue (60); // Me can't enge The problem with this implementation is: Suppose that the array size is 5, and 5 calls to EnQueue) have been made, now the queue array is full and Rear is 5. fron Rear- 5 1 10 20 30 40 50 Assume 3 calls to DeQueuel) are made: fron Rear- 5 40 50 The queue is not full, but it is WRONG to add at position indexed by Rear as it is out of bound! How can we solve this problem?! B. Circular Queue implementation using array (QueueCircular Arras:java): public class QueueCircularArray ( int front = 0, rear = 0, size = 0, count = 0; private int Queue(); QueueCircularArray (int maxSize) Queue = new int [maxSize); this.size = maxSize: public boolean isEmpty() ...3 lines public boolean isPull() 1...3 lines public int getFront() ...3 1.nes public int getRear() ...3 Lines public int getSize() [..3 lines public void EnQueue (int value) ... 10 lines public void De Queue () ... 10 lines public void display ( 1...20 lines Enqueue and Dequeue in QueueCircular Array class: public void EnQueue (int value) if (isPull) System.out.println("Queue is overflow); return } Queue (rear) - value: rear - frear . 1) sizes count. System.out.println(value Added to use."); public void DeQueue () 1 (1 Empty()) System.out.println("Queue is the flow) return System.out.printin (Queue front) + Deleted from Queen front - (front + 1) sites count Tasks/Assignments(s) 1. Create QueueCircular Array class in Java that implements Circular Queue using Array and implement all the following methods: enqueue, dequeue, getSize, getFront, getRear, is Full, isEmpty and display. In the main, create object myQueue from QueueCircular Array with the size of 5. Then do the followings: a. Enqueue the values (10,20,30,40,50) and call display method to display queue elements. b. Dequeue 3 elements and call display method to display queue elements. c. Enqueue (60) and call display method to display queue elements. Deliverables(s) You are required to implement and deliver a Java program(s) as described in the previous

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!