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

  Specify the most significant advantages and disadvantages

Specify the most significant advantages and disadvantages that could be realized by the organization in adopting a server virtualization infrastructure. Prepare a plan for implementing Hyper-V (or an alternate solution, such as VMware) as a solution ..

  Positive and negative characteristics of hybrid databases

A idea that several of the main database vendors have come up with is a hybrid database that integrates the concepts of both OO and Relational databases.

  Significant questions software installed by cable personnel

Interesting post on the computer discussion site (Slashdot) raises some significant questions about software installed by cable personnel.

  Write a program that asks the user for a year and computes

Write a program that asks the user for a year and computes whether that year is a leap year. I know how to build it, but I don't understand when it talks about the exceptions of 1582. Can someone explain this to me? Thanks.

  Explain object-oriented analysis and agile methodologies

Distinguish the object-oriented analysis and create models with structured analysis and design models. Write down Agile Methodologies?

  Anomalous behaviour of fifo

Describe Belady's anomaly and provide an example that illustrates anomalous behaviour of FIFO.

  Define the advantages of survey and observational methods

Compare the advantages of experiments with the advantages of survey and observational methods

  Securing owa

In order to effectively implement Outlook Web Access (OWA) and allow employees to have seamless access to email, you must provide external access to users. This, of course, creates a security weakness in your network because of open ports. Your senio..

  Design an algorithm that prompts the user to enter a number

Design an algorithm that prompts the user to enter a number in the range of 1 through 100 and validates the input.

  Overview of query optimization in relational systems

The contents must also conform to IEEE Conference Papers. Specifically, the conclusion must include your critical comments on the topic - Write a Paper on an overview of Query Optimization in Relational Systems

  Convert decimal number in sixteen bit binary

Convert decimal number +25 and +3 in 16-bit binary. Illustrate your work. Add binary numbers in above question using rules for binary addition.

  Operation of the chosen embedded control system

Choose an industrial embedded control system and write a report of a minimum of 3000 words covering the following aspects: Describe the basic elements and operation of the chosen embedded control system.

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