Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation for Queue #401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Data Structures/Queue/Queue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Data Structures/Queue/README.md
Original file line number Diff line number Diff line change
@@ -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)