Showing posts with label Queue. Show all posts
Showing posts with label Queue. Show all posts

PriorityQueue based on custom Priority setting

Just by name "Queue" we can think of big "Q" for Movie tickets booking in our olden days or have read about FIFO order. But here "PriorityQueue" is little different and it follows same...

Implementing Queue in Java

Queue is a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first to be removed. Suppose if a queue contains 4 elements and...

PriorityBlockingQueue in Java

In our last tutorial we have see about PriorityQueue and how its used in Java with simple example. In this tutorial we will see about PriorityBlockingQueue and it works and also the difference between...

PriorityQueue in Java

PriorityQueue is unbounded priority queue based on priority heap.  Basically PriorityQueue are ordered according to natural ordering or by a Comparator provided at queue construction time, depending on which constructor is used.  Another important...