Titsjgrosdnle Here



Download 134,23 Kb.
bet3/3
Sana16.06.2022
Hajmi134,23 Kb.
#677148
1   2   3
Bog'liq
kilich 3

It is important to note that a priority queue only supports elements that are comparable. Elements are called comparable if they are either lesser than, equal to or greater than one another, i.e. if the two elements are a and b, they should follow one of the conditions:

It is important to note that a priority queue only supports elements that are comparable. Elements are called comparable if they are either lesser than, equal to or greater than one another, i.e. if the two elements are a and b, they should follow one of the conditions:

i) a

ii) a=b

iii) a>b

As a result, the items in the priority queue are arranged in ascending or descending order.

It is an Abstract Data Type that functions a little differently than a normal Queue. In a normal Queue, first-in-first-out is followed which means that whichever elements enters the queue first, will be the first to leave. Just like any queue we form, the person that stands first in the queue, will be addressed first and similarly, even in computer science queues, the same rule applies.

Characteristics of a Priority Queue

A queue is called a Priority Queue when it has the following characteristics:

  • Each item in the queue must have a priority associated with it.
  • Higher or lower priority elements must be dequeued before lower or higher priority elements respectively depending on priority order taken by user that is if user consider lower number as higher priority or higher number as higher priority.
  • If two elements in the queue have the same priority value then the first in first out rule is followed for these two elements alone i.e. the element that entered the priority queue first will be the first to be removed.

Thank You


Download 134,23 Kb.

Do'stlaringiz bilan baham:

1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish