A queue is a data structure that follows the First-In-First-Out (FIFO) principle, meaning the first element added is the first one to be removed. It is similar to a line of people waiting for service, where the person at the front is served first. Queues are commonly used in computer science for managing tasks, such as print jobs or processes in operating systems.
In programming, queues can be implemented using arrays or linked lists. They support two main operations: enqueue, which adds an element to the back, and dequeue, which removes an element from the front. Queues are essential for scenarios like scheduling and resource management.