Please help with C++Priority Queue question in C++ language. Sample output also in image. Thanks.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please help with C++Priority Queue question in C++ language.

Sample output also in image. Thanks.

Part 2: Priority Queue
Using the effect of the following operation sequence on the heap implementation of the priority
queue ADT.
myqueue.insert(59);
myqueue.insert(41);
2
CPSC 250
Fall 2021
myqueue.insert(25);
myqueue.insert(12);
myqueue.insert(91);
myqueue.min();
myqueue.extractMin();
myqueue.insert(34);
myqueue.insert(63);
myqueue.extractMin();
myqueue.insert(75);
myqueue.insert(85);
myqueue.extractMin();
Using a heap, implement the priority queue class. The class should have a static constant
member variable, CAPACITY, which is the maximum size of the heap and an array, data, that
contains the heap with the entries. (should use priorityQueue.h & dirver.cpp in the D2L)
Transcribed Image Text:Part 2: Priority Queue Using the effect of the following operation sequence on the heap implementation of the priority queue ADT. myqueue.insert(59); myqueue.insert(41); 2 CPSC 250 Fall 2021 myqueue.insert(25); myqueue.insert(12); myqueue.insert(91); myqueue.min(); myqueue.extractMin(); myqueue.insert(34); myqueue.insert(63); myqueue.extractMin(); myqueue.insert(75); myqueue.insert(85); myqueue.extractMin(); Using a heap, implement the priority queue class. The class should have a static constant member variable, CAPACITY, which is the maximum size of the heap and an array, data, that contains the heap with the entries. (should use priorityQueue.h & dirver.cpp in the D2L)
My priority Queue is empty
After inserting 59 Priority Queue has
59,
After inserting 41 Priority Queue has
41, 59,
After inserting 25 Priority Queue has
25, 59, 41,
After inserting 12 Priority Queue has
12, 25, 41, 59,
After inserting 91 Priority Queue has
12, 25, 41, 59, 91,
After extracting the minimum value Priority Queue has
25, 59, 41, 91,
After inserting 34 Priority Queue has
25, 34, 41, 91, 59,
After inserting 63 Priority Queue has
25, 34, 41, 91, 59, 63,
After extracting the minimum value Priority Queue has
34, 59, 41, 91, 63,
After inserting 75 Priority Queue has
34, 59, 41, 91, 63, 75,
After inserting 85 Priority Queue has
34, 59, 41, 91, 63, 75, 85,
After extracting the minimum value Priority Queue has
41, 59, 75, 91, 63, 85,
Mininum value is 41
Press any key to continue
Transcribed Image Text:My priority Queue is empty After inserting 59 Priority Queue has 59, After inserting 41 Priority Queue has 41, 59, After inserting 25 Priority Queue has 25, 59, 41, After inserting 12 Priority Queue has 12, 25, 41, 59, After inserting 91 Priority Queue has 12, 25, 41, 59, 91, After extracting the minimum value Priority Queue has 25, 59, 41, 91, After inserting 34 Priority Queue has 25, 34, 41, 91, 59, After inserting 63 Priority Queue has 25, 34, 41, 91, 59, 63, After extracting the minimum value Priority Queue has 34, 59, 41, 91, 63, After inserting 75 Priority Queue has 34, 59, 41, 91, 63, 75, After inserting 85 Priority Queue has 34, 59, 41, 91, 63, 75, 85, After extracting the minimum value Priority Queue has 41, 59, 75, 91, 63, 85, Mininum value is 41 Press any key to continue
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education