Types of Queue
In the previous chapter, we learned the queue called simple.
Let’s briefly look at other types of queues:
- Simple queue;
- Circular queue;
- Priority queue;
- Double ended queue.
Circular queue
The name of the queue tells us how it works. In a simple queue, the first customer goes home after purchasing (it is customary in real life:) ). In a circular queue, the first customer becomes the last one.
Priority queue
A priority queue is a particular type in which each element is associated with a priority and is served according to its importance.
If elements with the same priority occur, they are served according to their order in the queue.
Double-ended queue
Unfortunately, the customer waiting to pay for their purchases may become the last customer, and the lucky previous customer becomes the first in the queue.
Tack för dina kommentarer!
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Ställ mig frågor om detta ämne
Sammanfatta detta kapitel
Visa verkliga exempel
Awesome!
Completion rate improved to 4.35
Types of Queue
Svep för att visa menyn
In the previous chapter, we learned the queue called simple.
Let’s briefly look at other types of queues:
- Simple queue;
- Circular queue;
- Priority queue;
- Double ended queue.
Circular queue
The name of the queue tells us how it works. In a simple queue, the first customer goes home after purchasing (it is customary in real life:) ). In a circular queue, the first customer becomes the last one.
Priority queue
A priority queue is a particular type in which each element is associated with a priority and is served according to its importance.
If elements with the same priority occur, they are served according to their order in the queue.
Double-ended queue
Unfortunately, the customer waiting to pay for their purchases may become the last customer, and the lucky previous customer becomes the first in the queue.
Tack för dina kommentarer!