DataStructures.jl
DataStructures.jl copied to clipboard
Clarify priority in PriorityQueue
Is the element with the largest or smallest priority first in the queue?
It seems to be the smallest priority:
julia> p = PriorityQueue(["a" => 5, "b" => 10, "c" => 15]);
julia> dequeue_pair!(p)
"a" => 5
It depends on the ordering direction (Forward or Reverse). The default is Forward, meaning the lowest value has the highest priority.
!close
This can be closed as the documentation (now) clearly states that default ordering is min (Forward).