Question: AQueue using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Queue_Array { public class AFIFOQueue { public int[] arr; public int front, rear; public int

 AQueue using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Queue_Array

{ public class AFIFOQueue { public int[] arr; public int front, rear; AQueue using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Queue_Array { public class AFIFOQueue { public int[] arr; public int front, rear; public int size; public AFIFOQueue(int Size) { arr = new int[Size]; size = Size; front = -1; rear = -1; } public bool Empty() { if (rear == -1) return true; else return false; } public bool Full() { if (rear == front - 1 || front == 0 && rear == size - 1) return true; else return false; } public void Enqueue(int x) { if (!Full()) { if (rear == -1) //empty queue { front = 0; rear = 0; } else { if (rear != size - 1) //rear not reach the last index rear = rear + 1; else rear = 0; //rear reach the last index, must jump to the first (circular queue) } arr[rear] = x; } else Console.WriteLine("The queue is full!"); } public int Dequeue() { if (!Empty()) { int x = arr[front]; if (front != rear) //more than one elements in the queue { if (front != size - 1) //regular case front = front + 1; else //front is at the end of the array, move it to the first (circular queue) front = 0; // } else //front = rear, only one element in the queue { front = -1; //after delete it becomes empty queue rear = -1; } return x; } else { Console.WriteLine("The queue is empty!"); return -1; } } public void Print() { if (rear == -1) Console.WriteLine("The queue is empty!"); else if (rear >= front) for (int i = front; i  

Modify the AQueue.cs program that implements a FIFO queue of Employee records using an array as its underlying physical data structure. The program must contain the following 2 operations: enqueue and dequeue. Also, the method for showing the queue must be able to print the contents in FIFO order and handle the case of circular queue. Your Main method should show how the employee record can be enqueued and dequeued

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!