Question: 1D (10 points) A priority Queue has the following two basic operations: Insert a new item Remove the item with the largest key. (This also
1D (10 points) A priority Queue has the following two basic operations: Insert a new item Remove the item with the largest key. (This also includes FINDING the max.) We considered several underlying implementations of the priority queue each with widely varying performance characteristics. Complete the following table using O(l), O(lg N), O(N), O(N lg N) or O(N2) to denote the complexity of each operation using the given implementation strategy on the left. Please assume the array will not need a resize operation during an insert or remove for this exercise and that list implies a singly list with head and tail pointers. Insert Remove Maximum Unordered Array Unordered List Ordered Array Ordered List Heap 2) (10 points) (A.) Describe an algorithm for removing the maximum from a priority queue implemented as an unordered list. (B.) Describe an algorithm for inserting a new key value into a priority queue implemented as an ordered array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
