FIFO stands for First In, First Out. FIFO is a type of data handling where element that is first to come will be first element to be processed.
In technical terms, FIFO means that element which was stored as first element will befirst to be removed. It happens so because FIFO follows a queue type data structure. Thus, oldest element or element that was encountered first during this operation will get out first as it will be in the front.
Example for this is Ticket counter present at movie theaters or stalls. The first one in line will be first one to get ticket and will leave first. The last person to enter line will be last one to leave because it will get ticket in the last.
Characteristics of FIFO :
- Queue, a linear data structure is implemented using FIFO principle.
- Elements are added/removed from different end so there is no criteria of wait and hold.
- A fixed amount of memory is consumed as memory utilization will not vary with each operation.
- Data Structures –
Certain data structures like Queue and other variants of Queue uses FIFO approach for processing data.
- Disk scheduling –
FIFO is used in Disk Scheduling Algorithms by disk controllers to decide which process came in first to be executed.
- Communications and networking –
Packets are held in between routers in order of their arrivals by use of FIFO technique. This helps in deciding which packet is to be transferred in which order.
- It is easy to implement and understand.
- It is used in many real-world applications like ticket counter of movie halls, railway counters, etc.
- Elements cannot be accessed randomly as FIFO only supports First In First Out methodology.
- The process effectiveness is low.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.