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
Get step-by-step solutions from verified subject matter experts
