From cdbcb5ec98f6e2b75d528292210259036f622274 Mon Sep 17 00:00:00 2001 From: Manan-Rathi <76519771+Manan-Rathi@users.noreply.github.com> Date: Wed, 6 Oct 2021 16:45:45 +0530 Subject: [PATCH] Add README.md for Queue (#2483) --- DataStructures/Queues/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 DataStructures/Queues/README.md diff --git a/DataStructures/Queues/README.md b/DataStructures/Queues/README.md new file mode 100644 index 000000000..e110686ac --- /dev/null +++ b/DataStructures/Queues/README.md @@ -0,0 +1,23 @@ +# Queue +- The Queue interface is present in the `java.util` package. +- It is an ordered list of objects that follows the **FIFO** (First-In-First-Out) principle. + +## Characteristics of a Queue +- The Queue is used to insert elements at the end of the queue and removes elements from the beginning of the queue. +- It supports all methods of Collection interface including insertion, deletion etc. +- LinkedList, ArrayBlockingQueue and PriorityQueue are the most commonly used implementations. + +## Declaration + +`Queue queue = new PriorityQueue ();` + +## Important operations + +| Operations | Description | +| ----------- | ----------- | +|Enqueue|Adds an item to the queue| +|Dequeue|Removes an item from the queue| +|Front|Gets the front item from the queue| +|Rear|Gets the last item from the queue| + +