8. Prioirty Queue #
Created Sunday 03 May 2020
-
max heap - priority_queue
-
The priority_queue is actually a max priority queue.
-
The only difference is in the remove and insert functions, i.e < becomes > and vice-versa, i.e sifting condition.
-
priority_queue<int, vector
, greater > for min hep. -
No need to include
, as queue has it already. -
By default, the functor is less
. -
By default, priority_queue<int, vector
, less > -
We will see the details afterwards.