Queues
A queue is a list in which insertion can be perform at rare end of queue and deletion can be perform from front end of queue. It’s basically works on act of FIFO (First in, First out).
Basic Operations on Queue
- Insert
- Delete
- Top (Returns topmost element of queue)
- IsEmpty (Which returns TRUE if queue is empty)
Properties of Queue
- Insertion is at last and Deletion is of first element from the list.
- Top of queue points to first in element.
- Queue can be static or dynamic in size.
- The indexing of particular element of queue depends on the basic list which we have use to implement it.
Priority Queues
A queue in which we are able to insert items or remove items from any position based on some priority is called priority queue.
Two types of Priority Queues
- Input according to priority
- Output according to priority