1/8
Looks like no tags are added yet.
Queue
An ordered list of objects with its use limited to inserting elements at the end of the list and deleting elements from the start of the list
Creating Queue
Create a class which extends this list in order to create an object
add()
Operation in Queue Interface where insertion order is not retained in the PriorityQueue; elements are stored based on the priority order (ascending by default)
remove()
Operation in Queue Interface where if multiple, first occurrence are removed
poll()
Operation in Queue Interface that is used to remove the head and return it
Iterating the Queue
Operation in Queue Interface that convert the queue to the array and traversing using the loop; queue also has an inbuilt iterator
PriorityQueue
Provides a way to process the objects based on the priority
LinkedList in Queue Interface
Inherently implements the linked list data structure
PriorityBlockingQueue
Alternative implementation if thread-safe implementation is needed