Author: Brandon Pearman

The views expressed here are mine alone and do not reflect the view of my employer.

  • Is a Linear data structure
  • Operations can only be performed at the end of the structure and not in the middle.

Queue Terms

  • Enqueue: Add an item to the back of the queue.
  • Dequeue: Take in item from the front of the queue.

A queue data structure works the same as a queue of people, in the sense that the first person who entered the queue will be the first person out of the queue.

The first item put in the queue is the first item taken out.

For example:

  • queue.Enqueue("A");
  • queue.Enqueue("B");
  • queue.Enqueue("C");
  • queue.Enqueue("D");

After the above Enqueues the queue will look like this:

When you dequeue the queue, the first item out of the queue will be "A".

  • var val = queue.Dequeue(); // val = "A"

Check out these links for more info:

My Queue Code