A queue is a linear data structure that operates on a first-in, first-out (FIFO) basis, allowing insertion at one end (rear) and deletion from the other end (front). It differs from a stack, which is last in, first out (LIFO) and only allows operations at one end. Various types of queues exist, including linear queues, circular queues, and priority queues, each with specific applications in computer science, such as resource scheduling and graph traversal.
Related topics: