top of page

[Blog 011] Data Structures: Queue Introduction

A queue is a linear data structure that operates on the principle of "first-in-first-out" or "FIFO." It is a collection of elements where the first item to be inserted will be the first to be removed [1]. This means that new elements are added at the "rear" and removed from the "front" of the queue [2].


Queues have a wide range of practical applications in computer science. For example, they can be used to manage shared resources between multiple consumers, such as CPU scheduling and disk scheduling [3]. Another common use case for queues is when data is transferred asynchronously between two processes, such as in IO buffers and pipes. Queues also play an important role in operating systems, as they are used in semaphores to ensure that critical sections of code are executed in a controlled order.


So, whether you're an experienced programmer or just starting out, it's important to have a solid understanding of the basics of queues and their various applications. With this knowledge, you'll be well on your way to creating efficient and effective algorithms for a wide range of use cases.


References

[1] "A queue is linear data structure that consists of a collection is of items that follow a first-in-first-out sequence. This implies that the first item to be inserted will be the first to be removed. You can also say that items are removed in the order they were inserted." URL: https://www.freecodecamp.org/news/queue-data-structure-definition-and-java-example-code/ [2] "A queue is a linear list of elements in which deletion of an element can take place only at one end called the front and insertion can take place on the other end which is termed as the rear. The term front and rear are frequently used while describing queues in a linked list. In this chapter, you will deal with the queue as arrays." URL: https://www.w3schools.in/data-structures/queue [3] "Useful Applications of Queue When a resource is shared among multiple consumers. Examples include CPU scheduling, Disk Scheduling . When data is transferred asynchronously (data not necessarily received at the same rate as sent) between two processes. Examples include IO Buffers, pipes, etc. Applications of Queue in Operating systems: Semaphores" URL: https://www.geeksforgeeks.org/applications-of-queue-data-structure/

8 views0 comments

Comments


bottom of page