diff --git a/Data Structures/Queue/Queue.png b/Data Structures/Queue/Queue.png new file mode 100644 index 00000000..5e875de3 Binary files /dev/null and b/Data Structures/Queue/Queue.png differ diff --git a/Data Structures/Queue/README.md b/Data Structures/Queue/README.md new file mode 100644 index 00000000..bc01c90c --- /dev/null +++ b/Data Structures/Queue/README.md @@ -0,0 +1,13 @@ +# Queue +A queue, like the name implies, is a type of linear datastructure that operates on a first in first out basis. As such, elements are always added to the back of the queue and subsequently removed from the front. This means that if you wanted to remove an element in the middle of the queue, you would have to remove all the elements that were added before it in order to do so. + +Queues are very similar to stacks with the only difference being the order the elements are removed. You would want to use a queue in scenarios where you want to preserve the order while processing data such as purchase requests or reading text files. +# + +![Queue](Queue.png) +Image taken from Wikipedia + +### Explanation +- **Enqueue**: Inserting items into the queue (the back) +- **Dequeue**: Removing items from the queue (the front) +