Skip to content

Commit cdbcb5e

Browse files
authored
Add README.md for Queue (TheAlgorithms#2483)
1 parent 30d9631 commit cdbcb5e

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

DataStructures/Queues/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Queue
2+
- The Queue interface is present in the `java.util` package.
3+
- It is an ordered list of objects that follows the **FIFO** (First-In-First-Out) principle.
4+
5+
## Characteristics of a Queue
6+
- The Queue is used to insert elements at the end of the queue and removes elements from the beginning of the queue.
7+
- It supports all methods of Collection interface including insertion, deletion etc.
8+
- LinkedList, ArrayBlockingQueue and PriorityQueue are the most commonly used implementations.
9+
10+
## Declaration
11+
12+
`Queue<Obj> queue = new PriorityQueue<Obj> ();`
13+
14+
## Important operations
15+
16+
| Operations | Description |
17+
| ----------- | ----------- |
18+
|Enqueue|Adds an item to the queue|
19+
|Dequeue|Removes an item from the queue|
20+
|Front|Gets the front item from the queue|
21+
|Rear|Gets the last item from the queue|
22+
23+

0 commit comments

Comments
 (0)