Skip to content

Commit 06aa834

Browse files
authored
Enhance queue README.md (TheAlgorithms#4710)
1 parent 7f9555b commit 06aa834

File tree

1 file changed

+25
-0
lines changed
  • src/main/java/com/thealgorithms/datastructures/queues

1 file changed

+25
-0
lines changed

src/main/java/com/thealgorithms/datastructures/queues/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@
77
- It supports all methods of Collection interface including insertion, deletion etc.
88
- LinkedList, ArrayBlockingQueue and PriorityQueue are the most commonly used implementations.
99

10+
11+
## Types Of Queue:-
12+
13+
- **FIFO Queue (First-In-First-Out):** This is the most common type of queue where the first item added is the first one to be removed. It follows a strict order of insertion and removal.
14+
15+
16+
- **Priority Queue:** Elements in this queue are assigned priorities, and the item with the highest priority is dequeued first. It doesn't strictly follow the FIFO order.
17+
18+
19+
- **Double-ended Queue (Deque):** A queue that allows elements to be added and removed from both ends. It can function as both a FIFO queue and a LIFO stack.
20+
21+
22+
- **Circular Queue:** In this type, the last element is connected to the first element, forming a circular structure. It's often used for tasks like managing memory buffers.
23+
24+
25+
- **Blocking Queue:** Designed for multithreaded applications, it provides thread-safety and blocking operations. Threads can wait until an element is available or space is free.
26+
27+
28+
- **Priority Blocking Queue:** Similar to a priority queue but thread-safe, it allows multiple threads to access and modify the queue concurrently while maintaining priority.
29+
30+
31+
- **Delay Queue:** Used for scheduling tasks to run after a specific delay or at a certain time. Elements are removed from the queue when their delay expires.
32+
1033
## Declaration
1134

1235
`Queue<Obj> queue = new PriorityQueue<Obj> ();`
@@ -21,3 +44,5 @@
2144
|Rear|Gets the last item from the queue|
2245

2346

47+
48+

0 commit comments

Comments
 (0)