Menu

(Solved) : Java Write Compare Two Implementations Priority Queue Whose Highest Priority Element One S Q37207809 . . .

JAVA

Write and compare two implementations of a priority queue whosehighest-priority
element is the one with the smallest key value. The firstimplementation
uses a minimum heap. You need to modify the heap operations to keepthe minimum—
rather than maximum—element in the root. The secondimplementation
uses a linear linked list whose elements are ordered by key value.Create a data
set that contains 50 elements with priorities generated by arandom-number
generator. To compare the operations, you must modify the e nque ueand
de que ue operations to count how many elements are accessed(compared or
swapped, in the case of reheaping) during its execution. Write adriver to
enqueue and dequeue the 50 test elements and print out the numberof elements
accessed for the operations. Run your driver once with eachimplementation.

Deliverables
• A listing of specification and implementation files for bothpriority queue
implementations
• A listing of your driver
• A listing of your test data
• A listing of the output from both runs
• A report comparing the number of elements accessed in executingeach operation

Expert Answer


Answer to JAVA Write and compare two implementations of a priority queue whose highest-priority element is the one with the smalle…

OR