Question: In C++ please show that code works and I will for sure give up vote. Your assignment is to write and compare two implementations of

 In C++ please show that code works and I will for

In C++ please show that code works and I will for sure give up vote.

Your assignment is to write and compare two implementations of a priority queue whose highest priority element is the one with the smallest key value. The elements have the following declarations: 1. The first implementation uses a minimum heap. You need to modify the heap operations to keep the minimum, rather than the maximum element in the root. The comparison function should compare key fields. 2. The second implementation uses a linear linked list, whose elements are ordered by key value. Test Data Create a data set that contains 50 items with priorities generated by a random-number generator. Comparing the Implementations To compare the operations, you must modify the Enqueue and Dequeue operations to count how many elements are accessed (compared or swapped, in the case of reheaping) during its execution. Write a driver to Enqueue and Dequeue the 50 test items and print out the number of elements accessed for the Enqueue and Dequeue operations. Run your driver once with each implementation. Deliverables - A listing of specification and implementation files for both priority 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 executing each operation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!