Write and compare two implementations of a priority queue

Assignment Help Basic Computer Science
Reference no: EM131229357

Write and compare two implementations of a priority queue whose highest-priority element is the one with the smallest key value. The first implementation uses a minimum heap. You need to modify the heap operations to keep the minimum-rather than maximum-element in the root. The second implementation uses a linear linked list whose elements are ordered by key value. Create a data set that contains 50 elements with priorities generated by a random-number generator. To compare the operations, you must modify the e nque ue and de que ue 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 elements and print out the number of elements accessed for the operations. Run your driver once with each implementation.

• 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: EM131229357

Questions Cloud

Discuss the factors that affect responsiveness : What are some factors that affect an individual's willingness to communicate? List at least three ways that leaders can work with a low willingness to communicate individual.
Compare and contrast the candidates positions : 1) Objectively compare and contrast the candidates positions and intentions in the three debate topic areas (use headers to separate). 2) Reflect on how positions/policy proposals relate to topics discussed in MGT 1; for example:
What is the situation with manufacturers in your area : What is the situation with manufacturers in your area?  Are they firing workers or hiring more?  What are some of the environmental factors affecting local plants?
How these changes might make you a more effective leader : Discuss your conflict style(s) and how they affect your communication in the workplace. Write a short essay explaining what skills for managing emotions and conflict you use as aids when you communicate in the workplace or at home (pp. 133-137).
Write and compare two implementations of a priority queue : Write and compare two implementations of a priority queue whose highest-priority element is the one with the smallest key value.
What is the definition of acturial science : What is the definition of acturial science? How does acturial science help the community at large?
Information systems administrator with a small company : You have recently been hired as an Information Systems Administrator with a small company that has been growing very rapidly. The company has simple IS policies, systems, and documentation.
What does the privacy policy cover that reassures you : Review Exhibits 6.2 (page 139) and 6.14 (page 158). What conclusions can you make about Purina's customers and brand based upon these and the opening story? Classify each of the research methods used by Purina using concepts from Chapter 6.
Derive the closed loop transfer functions : CONTROL SYSTEMS AND AUTOMATION - BASIC PRINCIPLES - Derive the closed loop transfer functions for the system shown in FIGURE 4 and show that for large values of G the value of Vo/Vi approaches unity.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine the output displayed when the button is clicked

Write a program that displays the output shown in a list box. The last two lines of the output should be displayed by one or more Sub procedures using data passed by variables from an event procedure.

  Advantages and disadvantages of cloud computing

Determine whether or not government agencies such as the National Security Agency (NSA) or Central Intelligence Agency (CIA) would be good candidates for cloud computing. Provide a rationale for your response.

  Write the code segment needed to set the data variable

Write the code segment needed to set the data variable to 25, and the tag string to "Hello World".

  Determining asymptotic formula for recurrence equations

Give an asymptotic formula for each of the recurrence equations given below, using big "Θ" rather than just big "O" for better results when possible.

  Draw a circle that is one inch in diameter

Have a fellow student act as the mechanical arm and carry out your instructions. Do not tell your mechanical arm partner what he or she will be drawing (or writing) before the partner attempts to carry out your instructions.

  Attribute highest information gain

Which attribute has the highest information gain? Justify your answer. Use Gini Index (1 - p12 - p22) as measurement criteria.

  First steps in developing any kind of software

One of the first steps in developing any kind of software is identifying who your users are. This then allows you to incorporate elements that are important to them, and grants you insights into how your target audience would use, or attempt to us..

  Possible combination of electrical states in the inputs

What table shows the electrical state of a digital circuit's output for every possible combination of electrical states in the inputs?

  Design a class numbers

Design a class Numbers that can be used to translate whole dollar amounts in the range 0 through 9999 into an English description of the number.

  Discuss host-based ids versus network-based ids

Discuss host-based IDS versus network-based IDS

  How to convert 8 bit binary to decimal, such as 01111111

How to convert 8 bit binary to decimal, such as 01111111?

  Results of the query into an ms word file

What to Turn in: Document all of your SQL scripts by copying the script and the results of the query into an MS Word file. As with the previous assignment, please include a listing of the data in each table and the table fields (i.e., use the SELE..

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