List-Based Heap Implementations: The book starts out by discussing the concept of a priority queue and how to implement it conceptually. Then, the first implementation is presented: using an array or Python sequence to represent the heap. Data Storage: The book stores elements of a priority queue within a custom object (an _Item) which wraps and provides almost no support for the stored data. For this section, you will be storing your key and value as an ordered pair (or tuple) of two values where the first element is the key and the second element is the value. 1. What are the inherent benefits and drawbacks of this (array-based) backing representation? Discuss with respect to implementation, efficiency, and memory usage. (PI 1.2/ABET[1], PI 6.1/ABET[6])
List-Based Heap Implementations: The book starts out by discussing the concept of a priority queue and how to implement it conceptually. Then, the first implementation is presented: using an array or Python sequence to represent the heap.
Data Storage: The book stores elements of a priority queue within a custom object (an _Item) which wraps and provides almost no support for the stored data. For this section, you will be storing your key and value as an ordered pair (or tuple) of two values where the first element is the key and the second element is the value.
1. What are the inherent benefits and drawbacks of this (array-based) backing representation? Discuss with respect to implementation, efficiency, and memory usage. (PI 1.2/ABET[1], PI 6.1/ABET[6])
Trending now
This is a popular solution!
Step by step
Solved in 2 steps