Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python You have been hired as a manager for Epicperson, the local superhero. Epicperson's greatest weakness is that they are extremely distractible: several villains have

Python image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
You have been hired as a manager for Epicperson, the local superhero. Epicperson's greatest weakness is that they are extremely distractible: several villains have escaped justice because Epicperson received a text reminder to pick up laundry mid-battle and simply left. You have decided to implement a priority queue to handle all of Epicperson's tasks, in which you assign an importance value to each task, and ensure that Epicperson only hears about the item that is currently of highest priority. Download the template PA3.py from the class website. The template includes a Task class, which consists of a description of a Task and a number representing its priority (higher values are more important). It also includes a Heap class, which is an extension of the normal Python list that includes a heap_size instance variable, and some slight alterations to a few built-in methods to differentiate between the list of Tasks, and the heap that is represented by only the first heap_size of those Tasks. The file also includes some test cases representing sets of tasks that Epicperson received, and the order that he should have completed them based on their relative priorities. You'll need to implement several methods which essentially mirror those in Chapter 6 of the textbook (max_heapify corresponds to Max-Heapify in the textbook, etc) in order to create a functional Priority Queue for Epicperson's Tasks. You have been hired as a manager for Epicperson, the local superhero. Epicperson's greatest weakness is that they are extremely distractible: several villains have escaped justice because Epicperson received a text reminder to pick up laundry mid-battle and simply left. You have decided to implement a priority queue to handle all of Epicperson's tasks, in which you assign an importance value to each task, and ensure that Epicperson only hears about the item that is currently of highest priority. Download the template PA3.py from the class website. The template includes a Task class, which consists of a description of a Task and a number representing its priority (higher values are more important). It also includes a Heap class, which is an extension of the normal Python list that includes a heap_size instance variable, and some slight alterations to a few built-in methods to differentiate between the list of Tasks, and the heap that is represented by only the first heap_size of those Tasks. The file also includes some test cases representing sets of tasks that Epicperson received, and the order that he should have completed them based on their relative priorities. You'll need to implement several methods which essentially mirror those in Chapter 6 of the textbook (max_heapify corresponds to Max-Heapify in the textbook, etc) in order to create a functional Priority Queue for Epicperson's Tasks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

=+Are you interested in working on global teams?

Answered: 1 week ago

Question

=+Do you want to work from home?

Answered: 1 week ago

Question

=+ What skills and competencies will enable someone

Answered: 1 week ago