Source Code available here:
https://www.instms.com/data-structure...
Queue in c or c++ is a data structure that uses FIFO order for the storage and retrieval of data items. In queue data items are inserted from one end and removed from other end. Queue data structure implement the following operations.
1. Enqueue
2. Dequeue
The process of inserting data item in queue is called enqueue. This operation normally use front of queue for the insertion of data items.
The process of removing data items from the queue is called dequeue. This process normally use rare of queue.
Queue used where we have to schedule some items or execution in First Come First Serve (FCFS) order. CPU also used queue data structure for job scheduling. Where the process initiated first will be executed first.In this session we also discussed difference between stack and queue.
We can implement queue using two methods these are as below.
1. queue using link list
2. queue using array
We prefer to implement queue data structure using link list whenever we have to deal with dynamic data structure. And we have not known total no of data items in advance. We also share visual animation of queue using link list and array in this video session.