Compare two implementations of a priority queue

Assignment Help C/C++ Programming
Reference no: EM132432104

Problem: In C++ I need an example of the following program. 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.

Data set must contain 50 items with priorities generated by a random-number generator.

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. Deliver 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

Reference no: EM132432104

Questions Cloud

Pro forma forecast for real company : Pro forma forecast for a real company: the students will pick a real-world company and forecast its AFN
What is the estimated NPV of the project : What is the estimated NPV of the project if the after-tax cost of capital (discount rate) is 12%? Use the built-in NPV function in Excel
Define the terms Racism and the shifting political landscape : Define the terms Racism and the shifting political landscape,Public health and reducing disease and accidental death,Voting right and violence,Personal change
Implementations of fibonacci number program : Discuss the implementations of the Fibonacci Number program at the end of this section to consolidate the students' understanding of the while loop repetition
Compare two implementations of a priority queue : Compare two implementations of a priority queue whose highest priority element is the one with the smallest key value.
Write a function called readfloatmap that reads : Write a function called readFloatMap that reads from a text file, stores its contents in a 2D array, and returns the number of lines it reads.
What is the total compensation expense : The requisite service period is five years with 20% of the options vesting each year from 2017 to 2021. What is the total compensation expense
What is the goal of terrorism : Is ISIS an insurgency or a terrorist organization. Explian why? What is meant by "terrorism is just war by other means?"Describe the "duality" of terrorism.
Write a program to sort the student names : Write a program to sort the student's names (ascending order), calculate students' average test scores and letter grades (Use the 10 point grading scale).

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write statements to prompt for and read

Write statements to prompt for and read the user's full name using a Scanner variable.

  The imperial system of measurements

The Imperial system of measurements uses feet and inches for length, where 1 foot is equal to 12 inches. Write a class named Imperial that will represent distance measurements in feet and inches. Your class should include the following.

  Develop code for the file-oriented input or output driver

CMPSC311- The bulk of this assignment is to develop code for the file-oriented input/output driver that uses the object store. Conceptually, you are to translate each of the below file I/O function calls into calls to the previously described CRUD..

  The project is to design and write a c11fltk game program

the project is to design and write a c11fltk game program with a graphical user interface. the game is based on

  To use a sentinel loop so once the value of -99 i

modify this program to use a sentinal loop so once the value of -99 is entered after getting the pay and hours the program should end.

  Need c++ solution to cover the final stage of euro 2012

From Group Fase to elimination fases, it´s not the user who defines teams, because that must be made automatically according to classification in group fase - considering regulations.

  Problem related to stroing of text file values into vector

I have to store the text file values into a vector and do the sum, here the text file sample: Expenses: Equipment:$300 Food: $50  Consumable expenses: $100

  Write a program to calculate the area of a circle

Write a program to calculate the area of a circle. The program should use two procedures. The first procedure will print out the program heading and ask the user to enter the radius. The second procedure should calculate the area. The area of the cir..

  Project - RATCH - The Ru bATCH job simulator

Operating Systems Project - RATCH - The Ru bATCH job simulator. For this project, you will build upon your interactive shell from project

  Compute the area and circumference of the circle

Write a C++ program that inputs the radius of a circle and then computes the area and circumference of the circle using the formua.

  Develop a crytographic scheme that will encode a message

Develop a crytographic scheme that will encode a message. In order to do that, you will convert a single character into its ascii code, add a certain integer value to it, and convert back into a character.

  Write a program that allows a user to enter 12 double values

Write a program that allows a user to enter 12 double values representing store sales for each month of one year. After all 12 values are entered,

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd