Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Programming Question: In class, we defined the Queue as following class Queue pu

ID: 3598227 • Letter: P

Question

Programming Question: In class, we defined the Queue as following class Queue public: Queue); bool empty0 const bool fullO const; QueueElement frontO: void Enqueue(QueueElement); void Dequeue); int size) private: QueueElement m_Array[CAPACITY]: int m Front, m Back A new class ModifiedQueue is defined below. It uses the above Queue as its data member m Queue to hold the items(ModifiedQueue's data member just contains m Queue). It includes two public member functions MergeQueue, and SplitQ. Implement all functions in implementation. cpp file. (10 points each) class ModifiedQueue public: Queue MergeQueue(Queue P): /e alternately merge queue item from P to private queue and return the merged queue Queue SplitQO: " Splito function returns a queue which consists of odd position of items from the private queue m Queue. "/ private: /* Define the private data member below. Queue m_ Queue;

Explanation / Answer

class ModifiedQueue

{

private:

Queue m_Queue;

public:

Queue MergeQueue( Queue P)

{

}

Queue splitQ()

{

Queue new_Queue;

bool odd_position=true;

if(odd_position){

new_Queue.Enqueue(this.m_Queue.front() );

this.m_Queue.Dequeue();

odd_position = false;

}

else{

this.m_Queue.Dequeue();

odd_position = true;

}

}

return new_Queue;

}

}