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 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