File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments