Data Structures¶
Queue¶
To create a queue
to insert an element
to see the head
to remove the head
Stack¶
To create a stack
to insert an element
to remove an element on top
to see the top of the stack
Heap¶
The PriorityQueue is based on the Priority Heap
// Priority Queue Min Type by deafault
PriorityQueue<object_type> heap = new PriorityQueue<>();
// Priority Queue Max Type use comparator
PriorityQueue<object_type> heap = new PriorityQueue<>(Collections.reverseOrder());
to add an element
to see the top of the queue
to remove the top element
to remove object o from the queue