Consider the queue of processes shown in Figure 4.9. The operating system maintains a queue for
scheduled processes that are ready to run. The dispatcher picks the process from the front end of the
queue and dispatches it to CPU and a new process joins at the rear end of the queue.
It may be noted that when the new processes join in, the size of the queue increases whereas the size
of the queue will reduce when processes finish their job and leave the system.
4.3.1 Queue Operations
A queue, being a linear data structure, can be comfortably mapped on a one-dimensional array. Let us
consider a queue maintained in an array
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.