Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Queue in java Complete the below java program by adding the following methods: class Queue private int front, rear, size; private int arro[]; Queue(ints) {
Queue in java
Complete the below java program by adding the following methods: class Queue private int front, rear, size; private int arro[]; Queue(ints) { front =-1; rear = -1; size = s; arro = new int[size]; } 1. size() prints the number of elements in the queue. (void method) 2. isEmpty) checks if the queue is empty or not. (return type is beglean) 3. iskull!) checks if the queue is full or not. (return type is boolean) 4. front() prints the first element of the queue. (void method) 5. enqueue(int item) checks if the queue is not full then add item on the rear. (void method) 6. dequeuel) checks if the queue is not empty then removes the element on front. (void method) 7. display() prints all elements of the queue 8. split() splits the elements of the queue in two queues and prints the two queues. (void method). Ex: q = 10Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started