PRIORITY QUEUE
each element has a priority associated with it
In a priority Queue an element with highpriority
is served before an element with low priority
If two elements have the same priority they
are served according to their order in the queue
then
If the list S OchTime for insertion
based on the priority 011 time for deletion
If the List is not 115time for insertion
sorted ON time for deletion
Representation of prioritytiene
17 Aways
27 linked lists
linked list representation
START
It
ftp.I ithBB DD
th ER.FI I
characteristics
ex Priority Based Processing
27 Dynamic nature
37 Heap Implementation
Eection
2
pe it
i
YPI
i
iiiniti
ifi.int iiiiIifi
ftp.i
tiiifiii
4f
newnode
a
data val v
newnode Priority Pri
If START ULL OR IN START Priority
neurode next START
ns.ode.n
else 5
PH START
eepiiixiiii.in
whiteti
Cenowht newnode
next phenexk
sorted
Pte next newnode
end 04IT
DELETION
1ˢᵗS.it
PRIORITY QUEUE
Ltv
t.in
START NULL
Pff
If
Print underflow
else
FEET
temp
START next
START
Free temp
end to
end
Advantages
17Efficient Priority handling
27 Optimal for scheduling
34 Flexibility in Data Management
Disadvantages
ex complexity
27 Overhead
37 Potential inefficiency for simple use cases
Applications
14 CPU scheduling
27 Graph Algorithms
3 Network traffic Management
47 Real Time systems