In Programming and software development, data structures are used to store and arrange a set of values. There are various types of data structures for different use cases. They include stacks, queues, lists, etc. This article focuses on queues and basic operations that could be carried out on them.

What is the Queue Data Structure?

A Queue data structure works like queues in real life such as at shopping malls, payment counters, and airplane onboarding.

What are the applications of Queues?

  • Printer queues
  • Customer service hotlines
  • CPU Scheduling

The FIFO Concept

FIFO is an abbreviation for First In, First Out which explains the order by which actions carried out on queue work. The first object to come on the queue is the first object that goes out.

Hence, the addition of new elements happens from the end of the queue while the removal of elements happens at the beginning of the queue, just as queues in shopping malls.

This is in contrast to the stack data structure which addition(push) and removal(pop) of elements happen at the end of the queue. This is described as Last In, Last Out, LIFO You can learn more about Stack in this article, Stacks in Python.

#queue #data-structures #python

Using Queues in Python
3.00 GEEK