notes applications of queues one major application of the queue data structure is in the computer simulation of real-world situation queues are also used in many ways by the operating systemthe program that schedules and allocates the resources of computer system one of these resources is the cpu (central processing unititself if you are working on multi-user system and you tell the computer to run particular programthe operating system adds your request to its "job queuewhen your request gets to the front of the queuethe program you requested is executed similarlythe various users for the system must share the / devices (printersdisks etc each device has its own queue of requests to printread or write to these devices the following subsection discusses one application of the queues the priority queue it is used in time-sharing multi-user systems where programs of high priority are processed first arid programs with the same priority form standard queue priority queues priority queue is collection of elements such that each element has been assigned priority and such that the order in which elements are deleted and processed is defined by the following rulesan element of higher priority is processed before any element of lower priority two elements with the same priority are processed according to the order in which they were inserted into the queue we would use singly linked list to implement the priority queue each node of the linked list would have type definition as followsstruct qelement itemint priorityqelement *next*pqueue*front*rearthe algorithm for the insertion would change now insertion would insert the new element at the correct position according to the priority of the element the elements of the priority queue would be sorted in non-descending order of the priority with the front of the queue having the element with the highest priority the deletion procedure need not change since the element at the front is the one with the highest priority and that is the one that should be deleted void insert(pqueue *frontpqueue *reart eint /this inserts an element having data and priority into the priority queue */*the insertion maintains the sorted order of the priority queue *pqueue * *rpqueue *xint prx new(pqueue) ->item ex->priority lovely professional university