What is the definition of a priority queue

Assignment Help Basic Computer Science
Reference no: EM13973098

Goals: Implementation of binary search trees

Part 1 Describe your add, display, and remove algorithms using pseudo code.

Part 2 Answer the following questions

1) When would you use a binary search tree over an ordered or unordered array?

2) Give one way how implementing a heap differs from implementing a binary search tree.

3) How does the efficiency of binary search tree operations compare to that of linked lists?

4) How can binary search insertions degrade in performance to O(N), rather than O(Lg(N))?

5) Give an example of when pre-order traversal is desirable. What about post-order?

6) What is the definition of a priority queue?

7) How would you implement a priority queue where internal nodes could change priority? How would you find one of the internal nodes in the structure?

8) Prove that heap creation is O(N).

9) Define the term: Complete Binary Treee.

10) Prove that heap sort is (O(N Lg N))

Hints and Instructions

Implement your employee list program using the binary search tree data structure instead of the linked list implemented in the previous project. Create the employee list in a loop using random descriptions, prices, costs, and balance on hand just as was done in the previous project. Duplicate field values are ok; but duplicate item numbers are not allowed. Print out the employee list in item number order after the list is created.

Part 3

Randomly fill your employee list that uses an unordered array. Next randomly fill your employee list that uses a binary search tree. Time both approaches using different data set sizes and using data sets with different characteristics. Write a one or two page paper that analyzes the timing differences between your unordered array implementation and your binary search tree implementation.

For extra credit, implement a heap sort and quick sort that will order your unordered array. Time how long the each sort takes with different data set sizes. Write a one or two page paper that analyzes the timing differences between your two sorts.

When comparing algorithms, normally large data set sizes are needed. Also, picking array sizes that vary exponentially is useful to capture the attributes of the algorithms. For example, picking array sizes as 100000, 200000, 400000, 800000, etc. would be appropriate (Assuming that C allows array sizes that large).

You can use the C clock() for timing purposes, including <time.h>. The following is a sample snippet to demonstrate how this works.

clock_t start = clock();
/* do some cool stuff here */
clock_t end = clock();
double time = 1.0*(end - start)/CLOCKS_PER_SEC;
printf("The algorithm took %lf time\n", time);
fflush(stdout);

Part 4 Implement the program. Include files containing the typed answers to the part 1 questions, the pseudo-code

Attachment:- empstructs.h_0.zip

Reference no: EM13973098

Questions Cloud

Asking for a 90-day extension to take care of the cash flow : Write a debriefing report to include options for future activities to be presented to the board of directors detailing the following options:
Discuss two cost options that are being considered : Discuss two cost options that are being considered. Explain the reasoning process used to translate the written description of each cost option into algebraic equations.
What happens to the dipole and is there linear motion : What happens to the dipole? Is there linear motion? Justify your answer and also indicate the direction of motion. Is there rotational motion? Justify your answer and also indicate the direction of motion. If there is motion, will it continue, or ..
List the nine clinical and nonclinical uses of health record : List the nine clinical and nonclinical uses of the health record. Explain why it is important to know the different uses of the health record. Identify the HIM professional's responsibilities as custodian of the health record.
What is the definition of a priority queue : Give one way how implementing a heap differs from implementing a binary search tree.
How article reflect similar experience that you may have had : how it reflects similar experiences that you may have had, your overall assessment of its content, and what, if anything the article has added to your understanding of the textbook communication topic to which it relates.
Amount of the unrealized loss : The EZ Company stock was valued at $19 per share on December 31, 2008 Calculate the amount of the unrealized loss shown on ZZ, Inc.'s 2007 income statement.
Explaine procedures for protecting research participants : Create a 10-slide Microsoft PowerPoint Presentation explaining the guidelines and procedures for protecting research participants. Ensure all information is complete and concise.
What is the tension in the cables : What is the mass of the heaviest book this person can hold onto vertically before it slips out of his or her fingers? The coefficient of static friction of the surface between the fingers and the book cover is 0.65. Answer is not 0.397 kg.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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