Nội dung text queues.pdf
QUEUES BCA NOTES NEPAL4 1
Intro Movie Hall Ticketing BCA NOTES NEPAL4 2 One Way Traffic
BCA NOTES NEPAL4 3 Intro • Queue is a linear list of elements in which deletion of an element can take place at one end, called the front and insertion can take place at the other end, called the rear. • The first element in a queue will be the first one to be removed from the list. • Queues are also called FIFO (First In First Out) i.e. the data item stored first will be accessed first
Queue Representation • In queue, we access both ends for different reasons BCA NOTES NEPAL4 4
BCA NOTES NEPAL4 5 Applications of queue • Serving requests on a single shared resource, like a printer, CPU task scheduling etc. • In real life, Call Center phone systems will use Queues, to hold people calling them in an order, until a service representative is free. • Handling of interrupts in real-time systems. The interrupts are handled in the same order as they arrive, First come first served.