Text Practice Mode
Why Queue is called as FIFO structure?
created Aug 24th 2022, 21:59 by Gouri Mahato
2
179 words
16 completed
4
Rating visible after 3 or more votes
saving score / loading statistics ...
00:00
Queue is a linear data structure, in which elements can be inserted only though one end called REAR. Conversely elements can be removed rom another end, called FRONT.
In a queue elements can be inserted through REAR and removed through FRONT end. Therefore the elements will be removed in the same order as they are inserted. Those whatever the elements inserted first, is the first element to be removed. That's why Queue is called as first-in, first-out (FIFO) structure.
They are two basic operations of state line Queue -
1. Insertion:- This is the operation to insert an element into a straight line Queue. These operation is accompanied through the REAR end. Before insertion of an element we have to check, whether they are is any empty space or not. If there is no space than overflow situation will occur; otherwise REAR will be incremented by one end at that position new elements will be inserted.
The algorithm for the insertion operation is as follows-
QINSERT(QUEUE, N, REAR, FRONT, ITEM)
[This procedure inserts an element ITEM into a Queue.]
In a queue elements can be inserted through REAR and removed through FRONT end. Therefore the elements will be removed in the same order as they are inserted. Those whatever the elements inserted first, is the first element to be removed. That's why Queue is called as first-in, first-out (FIFO) structure.
They are two basic operations of state line Queue -
1. Insertion:- This is the operation to insert an element into a straight line Queue. These operation is accompanied through the REAR end. Before insertion of an element we have to check, whether they are is any empty space or not. If there is no space than overflow situation will occur; otherwise REAR will be incremented by one end at that position new elements will be inserted.
The algorithm for the insertion operation is as follows-
QINSERT(QUEUE, N, REAR, FRONT, ITEM)
[This procedure inserts an element ITEM into a Queue.]
