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

  Draw a pda for the language

Draw a PDA for the language L over {0,1} consisting of strings with an equal number of 0's and 1's. So 010011 would be in this language. Next draw a DFA recognizing 0?1?. Use the algorithm from class to draw a PDA for the intersection of these two..

  Python program that first displays a main menu

That is, if the total sale amount is $100 then the discount will be $0. However, if the total sale amount is $101 then the discount will be $0.10. If the total sale amount is $500 then the discount will be $40, but if the total sale amount is $501..

  Hardware requirements for implementing windows server

You were hired as a consultant to analyze an existing Windows Server environment in a utilizing Windows Server 2003 and 2008.

  Reference all your outside sources properly

You need to ship two GE Voluson 730 Ultrasound Systems from Wesley Hills, NY, USA to Bristol, UK for use in a new hospital (Southmead Hospital Bristol, NHS Trust) being built there. Prepare a request for quotation (RFQ) for the shipment of the mac..

  Discuss the different reasons for terminating a process

discuss the different reasons for terminating a process and the commands used for this purpose.

  Online education proving to be successful

Is online education proving to be successful? Your task is to provide a critical review of the current market for online education as well as providing an overview and definition of what online education is and how it works.

  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.

  Identify the difference between analog and digital signals.

Provide an example of a digital signal and an analog signal

  What does the memory model of a microcontroller show

What does the memory model of a microcontroller show? Discuss the reasons for different types of memory such as RAM, EEPROM, and FLASH used in HCS12.

  Find the sum of all the multiples

Write a program to find the sum of all the multiples of 3 or 5 below N. for example: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

  How do we make jar files

How do we make Jar files? What is a Jar file? How do we control what is in them? How do we make a Jar file executable?

  Handling the exception tl

Consider the function fun g(l) = hd(l) : : tl(l) handle Hd => nil; that behaves like the identity function on lists. The result of evaluating g(nil) is nil. Explain why. What makes the function g return properly without handling the exception Tl?

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