Question: For an Adaptable Priority Queue, if we use a heap system stored in an array. why do we need to have positional awareness? O An
For an Adaptable Priority Queue, if we use a heap system stored in an array. why do we need to have "positional awareness"? O An abstract data type based on an array is always of fixed size, and so a key can never be used to define the index Adaptable Priority Queues can't use the "protected swap" method in a regular priority queue. For example, when a key of an existing entry is replaced, (replaceKey(e, k)) the new key may violate the heap-order property. Thus, a separate array index is needed to keep track of the exact position in the array O Location awareness is not possible in adaptable priority queue, so an array index is required. The replaceIndex(i) method required for Adaptable Priority Queues must have a replaceable index
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
