Answered step by step
Verified Expert Solution
Question
1 Approved Answer
16.13 Homework9 (due Apr 8) Students This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content
16.13 Homework9 (due Apr 8) Students This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content to your instructor lf you have any technical issues with the zyLab submission system use the "Trouble with lab?" button at the bottom of the lab Implement a Priority Queue for strings. A priority queue is similar to a regular queue except each item added to the queue also has an associated priority. For this problem, make the priority an integer where 0 is the highest priority and larger values are increasingly lower in priority The remove function should return and remove the item that has the highest priority For example: q add ("X", 10); q add("Y", 1); q add ("Z", 3); cout q. remove Returns Y cout q.remove Returns Z Returns X cout q remove You can implement the priority queue by performing a linear search in the remove function. Hint: Take a look at the Linked List code example from 03/30, which can downloaded from D2L. Reusing the code example is acceptable and modifying it is acceptable. You are expected to use pointers You will get a 0 if you use STL:priorityqueue or any other already-implemented priority queue data structure. Important: Make sure to use the template provided since the test cases depend on it 16.13.1: Homework9 (due Apr 8) Lab Submission main Loppiefault template 1 #include kiostream 2 #include
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