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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started