A queue is a structure into which we can insert items at one end and remove them from the other. It has the property that the next item removed is the one that has been in the container for the longest amount of time. This is called first-in first-out (FIFO) storage. Queues are used internally in computer operating systems to manage many resources, such as current users. Since there is only a single CPU on most systems, only one user process can be active at a time. When the currently executing process gets interrupted, it is put into the user queue (an enqueue operation) and another process is removed (dequeued) and allowed to run. This guarantees that each process gets its turn to execute.
KeywordsRandom Access Priority Queue Input Range Quadratic Time Binary Predicate
Unable to display preview. Download preview PDF.