Consuming the Queue ADT

Now, let's create a new Queue instance that contains the different elements, as shown in the earlier diagram. The element will be inserted by using the Enqueue() operation. We can then display all queue elements by using the Front() and Dequeue() operations. The code should be as follows:

// Project: Queue.cbp// File : main.cpp#include <iostream>#include "Queue.h"using namespace std;int main(){    // NULL    Queue<int> queueInt = Queue<int>();    // Enqueue several numbers to the queue    queueInt.Enqueue(35);    queueInt.Enqueue(91);    queueInt.Enqueue(26);    queueInt.Enqueue(78);    queueInt.Enqueue(44);    queueInt.Enqueue(12);    // list the element of queue    while(!queueInt.IsEmpty())    {        // Get the front element cout << queueInt.Front() << ...

Get C++ Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.