Hi I have reposted the question again ONLY QUESTION 2 need t
Hi I have reposted the question again ONLY QUESTION 2 need to be answered
Part II: Queue (24 points) 1. (6 points) Define the class Queue using one n with members only (Enqueue, circular array no implementation; ie. declare the data members, Dequeue, IsEmpty, GetHcad etc.). Class GrrAryayt t nd tail 2. (5 points) Implement the IsEmpty/method of the above class. 3. (6 points) Implement the Enqueue method of the above class. 6“ccess) |- Page 3 Solution
In a circular array, the current value of head decides if the array is empty or not. In your case,
bool CirrArray::isEmpty() {
if (head == -1) return true;
else return false;
}
Do not forget to initialize both head and tail as -1 in constructor.
