Alpha Geek

(8)

$10/per page/Negotiable

About Alpha Geek

Levels Tought:
University

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Environmental science,Essay writing,Programming,Social Science,Statistics Hide all
Teaching Since: Apr 2017
Last Sign in: 345 Weeks Ago, 4 Days Ago
Questions Answered: 9562
Tutorials Posted: 9559

Education

  • bachelor in business administration
    Polytechnic State University Sanluis
    Jan-2006 - Nov-2010

  • CPA
    Polytechnic State University
    Jan-2012 - Nov-2016

Experience

  • Professor
    Harvard Square Academy (HS2)
    Mar-2012 - Present

Category > Programming Posted 01 May 2017 My Price 7.00

Write a template version of a class that implements

Write a template version of a class that implements a priority queue. Queues are discussed in Chapter 13 and priority queues are discussed in Chapter 18. To summarize, a priority queue is essentially a list of items that is always ordered by priority. Each item that is added to the list requires an associated priority value. For this problem, make the priority an integer where 0 is the highest priority and larger values are lower in priority. Removing an item from the queue removes the item with the highest priority. The add function of the priority queue should take a generic type and then an integer priority. In the following example, the generic type is a char and we have added three items to the queue:

The remove function should return and remove from the priority queue the item that has the highest priority. Given the example above, we would expect the following:

Test your queue on data with priorities in various orders (for example, ascending, descending, mixed). You can implement the priority queue by storing the items using a list(s) of your choice (for example, vector, array, linked list, or GenericList described in this chapter) and then performing a linear search for the item with the lowest integer value in the remove function. In future courses you may study a data structure called a heap that affords a more efficient way to implement a priority queue.

 

Answers

(8)
Status NEW Posted 01 May 2017 05:05 PM My Price 7.00

-----------

Attachments

file 1493660399-answer1.docx preview (374 words )
W-----------rit-----------e a----------- te-----------mpl-----------ate----------- ve-----------rsi-----------on -----------of -----------a c-----------las-----------s t-----------hat----------- im-----------ple-----------men-----------ts -----------a p-----------rio-----------rit-----------y q-----------ueu-----------e. -----------Que-----------ues----------- ar-----------e d-----------isc-----------uss-----------ed -----------in -----------Cha-----------pte-----------r 1-----------3 a-----------nd -----------pri-----------ori-----------ty -----------que-----------ues----------- ar-----------e d-----------isc-----------uss-----------ed -----------in -----------Cha-----------pte-----------r 1-----------8. -----------To -----------sum-----------mar-----------ize-----------, a----------- pr-----------ior-----------ity----------- qu-----------eue----------- is----------- es-----------sen-----------tia-----------lly----------- a -----------lis-----------t o-----------f i-----------tem-----------s t-----------hat----------- is----------- al-----------way-----------s o-----------rde-----------red----------- by----------- pr-----------ior-----------ity-----------. E-----------ach----------- it-----------em -----------tha-----------t i-----------s a-----------dde-----------d t-----------o t-----------he -----------lis-----------t r-----------equ-----------ire-----------s a-----------n a-----------sso-----------cia-----------ted----------- pr-----------ior-----------ity----------- va-----------lue-----------. F-----------or -----------thi-----------s p-----------rob-----------lem-----------, m-----------ake----------- th-----------e p-----------rio-----------rit-----------y a-----------n i-----------nte-----------ger----------- wh-----------ere----------- 0 -----------is -----------the----------- hi-----------ghe-----------st -----------pri-----------ori-----------ty -----------and----------- la-----------rge-----------r v-----------alu-----------es -----------are-----------
Not Rated(0)