The queue is a linear list with restricted operations. The end where the insertion operation is performed is called the tail of the queue, and the end where the deletion operation is performed is called the head of the queue. Or queue is a military term, usually stipulated by queue doctrine, which is used to regulate troops, unit queues and their movement formations and actions under various conditions, and to organize and implement training according to doctrine.
Queue (one of the commonly used data structures)
Queue is a special linear table, special features The reason is that it only allows deletion operations at the front end (front) of the table, and insertion operations at the rear end (rear) of the table. Like the stack, the queue is a linear list with limited operations. The end that performs the insertion operation is called the tail of the queue, and the end that performs the deletion operation is called the head of the queue.
When there are no elements in the queue, it is called an empty queue.
The data elements of the queue are also called queue elements. Inserting a queue element into the queue is called enqueuing, and deleting a queue element from the queue is called dequeuing. Because the queue only allows insertion at one end and deletion at the other end, only the element that enters the queue earliest can be deleted from the queue first, so the queue is also called a first-in-first-out (FIFO—first in first out) linear list.
Queue (military term)
Queue is usually specified by queue doctrine, which is used to regulate troops, unit queues and their movement formations under various conditions. actions, and organize and implement training in accordance with the regulations.
Queue is an organizational form of ranks formed by soldiers or departments and detachments when they act together. Queues are the external manifestation of the organizational structure of formal organized units.
The essence of queue is the stipulation of the "order" of the organization. The queue is not only the foundation of military training, but also the "mother of organization and the father of management." Ancient queues are like "living fossils" of organizations, telling people about the occurrence and development of human organizations.
The above is the detailed content of What is a queue?. For more information, please follow other related articles on the PHP Chinese website!