Category

Queue

Category

The queue is a data structure which process items using first in first out (FIFO) strategy. The queue has head and tail nodes. When the item inserts into the queue, the queue adds the items in the tail. The linked list store the next element address to the current node for identifying the next node. The last element linked list next node store NULL address.

A priority queue is a data structure with each element has a priority associated with it. The high priority element served before an element with low priority. Priority queue provides extra flexibility over sorting and quick access to the smallest and largest key in the queue.

The queue is an abstract data type, in which the element is inserted into the tail, and delete from the head. It stores the items using First in first out principle (FIFO). The queue can be implemented using an array or linked list. The enqueues insert an item to the tail. The dequeue removes the item from the head.