Thisismyroughkjhfdyhbfhjbgijggjnvkppt.pptx

AryanKaulCeNtEr 22 views 10 slides Oct 02, 2024
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

Hhjbvnbjbvnkffbnn


Slide Content

PRIORITY QUEUE By- Palak Sharma

A priority queue is a queue in which insertion and deletion of items from any position in the queue are done based on some property (such as priority of task). Priority queue contains data items which have some preset priority. While removing an element from a priority queue, the data item with the highest priority is removed first. In a priority queue, insertion is performed in the order of arrival and deletion is performed based on the priority. PRIORITY QUEUE

Rules: - An element with higher priority will processed before an element with a lower priority. 2. Two elements with the same priority are processed on a First Come First Serve basis(FCFS). The advantages of priority queue is :- Easy to implement. Processes with different priority can be efficiently handled. PRIORITY QUEUE CONTINUE

1. Ascending Priority Queue In this type of priority queue, elements can be inserted into any order but only the smallest element can be removed. 2. Descending Priority Queue In this type of priority queue, elements can be inserted into any order but only the largest element can be removed. TYPES OF PRIORITY QUEUE

Using Arrays :- Insertion Operation  While inserting elements in priority queue we will add it at the appropriate position depending on its priority • It is inserted in such a way that the elements are always ordered either in Ascending or descending sequence Deletion Operation  While deletion, the element at the front is always deleted. REPRESENTATION OF PRIORITY QUEUE

Priority queue is in scheduling the jobs in operating system . Operating system allocates priority to jobs , the jobs are placed in the queue and the position of the jobs in the priority queue determines their priority. In operating system there are three kinds of jobs . there are real time jobs, foreground jobs, and background jobs. The operating system always schedules the real time jobs first . If there is no real time job pending then it schedule foreground jobs . Lastly if no real time or foreground jobs are pending then operating system schedules the background jobs. 2. In network communication to manage limited bandwidth for transmission the priority queue is used . APPLICATION OF PRIORITY QUEUE

https://www.geeksforgeeks.org/priority-queue-set-1-introduction/ REFERENCE

THANK YOU
Tags