Get current working directory



Download 0,85 Mb.
bet3/26
Sana26.05.2022
Hajmi0,85 Mb.
#609643
1   2   3   4   5   6   7   8   9   ...   26
Bog'liq
notes2

What is a Queue?


A queue is an ordered list in which insertions are done at one end (rear) and deletions are done at another end (front). The first element to be inserted is the first one to be deleted. Hence, it is called First in First out (FIFO) or Last in Last out (LILO) list.
A queue is a data structure used for storing data (similar to Linked Lists and Stacks). In a queue, the order in which data arrives is important. In general, a queue is a line of people or things waiting to be served in sequential order starting at the beginning of the line or sequence.

Real World Examples


A real-world example of a queue can be a single-lane one-way road, where the vehicle enters first, exits first. More real-world examples can be seen as queues at the ticket windows and bus-stops.


Queue Concepts


  • When an element is inserted in a queue, the concept is called EnQueue.(element qo’shish)

  • When an element is removed from the queue, the concept is called DeQueue.(element o’chirish)

  • DeQueueing an empty queue is called underflow (treat as Exception).(bo’sh queue ga ishlatilgada)

  • EnQueuing an element in a full queue is called overflow (treat as Exception).(To’lgan queue ga ishlatilganda )

Queue Operations


Let's list out basic operations associated with queues −

  • enqueue() − add (store) an item to the queue.

  • dequeue() − remove (access) an item from the queue.

Few more functions are required to make the above-mentioned queue operation efficient. These are −

  • peek() − Gets the element at the front of the queue without removing it.

  • isFull() − Checks if the queue is full.

  • isEmpty() − Checks if the queue is empty.

In queue, we always dequeue (or access) data, pointed by a front pointer and while enqueuing (or storing) data in the queue we take help of rear pointer.
( har doim o’chirish old qismdan amalga oshiriladi. Qo’shish esa orqa tomondan )

Download 0,85 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   26




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