Question: Can someone please help writing a proper JAVA program per details below? public class LinkedIntQueue { private Node front, rear; // references for the ends

Can someone please help writing a proper JAVA program per details below? Can someone please help writing a proper JAVA program per details below?

public class LinkedIntQueue { 
 private Node front, rear; // references for the ends of the queue private int count; // Node count, number of items in queue 
 public LinkedIntQueue() { 
 front = null; rear = null; count = 0; 

}

 public int deque() { 
 int rv=0; // return value return rv; 

}

 public void enque(int d) { 
 Node newNode = new Node(d); } 
 public boolean isEmpty() { 
 return front == null; } 
public boolean isFull() { 
 return false; } 
 private class Node { 
 int data; Node next; 
 public Node(int d) { 

data = d; }

 }// End class Node 
 public static void main(String[] args) { 
 //create a queue 
 LinkedIntQueue iq = new LinkedIntQueue(); iq.enque(22); iq.enque(1); iq.enque(94); 
 System.out.println( iq.deque() ); } 

}

Queue Implemented with a Linked-List Write a queue class, using a singly linked-list, that allows your queue to store type int. Your class should have the following methods Method Name Return Type Description enque deque isEmpty isFull size none generiC boolean boolean int removes the element at the front of the queue and returns it inserts and element at the rear of the queue returns true if the queue is empty, false otherwise returns true if the queue is full, false otherwise returns the number of elements in a queue In your test class, create a queue and exercise all the methods The following code may be of help

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!