Question: Create the following c++ queue methods using Heap-style storage. bool enqueue(int v): inserts v into the queue. Checks if the heap is full before performing.

Create the following c++ queue methods using Heap-style storage.

bool enqueue(int v): inserts v into the queue. Checks if the heap is full before performing.

bool dequeue(int v): removes v from the queue. Checks if the heap is empty before performing

void printIt(int index, int count): prints the queue in the following manner: (Line 1 is the parent)

Line 1: 1

Line 2: 2 3 4

Line 3: 5

The other following variables are usable:

-int val* : points to an array that holds the integers

-int counter: records the number of entries in the Queue

-int pqSize = 100: records the max size of the Heap.

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!