Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify priority in PriorityQueue #698

Open
dpsanders opened this issue Nov 4, 2020 · 3 comments
Open

Clarify priority in PriorityQueue #698

dpsanders opened this issue Nov 4, 2020 · 3 comments

Comments

@dpsanders
Copy link
Contributor

Is the element with the largest or smallest priority first in the queue?

@dpsanders
Copy link
Contributor Author

It seems to be the smallest priority:

julia> p = PriorityQueue(["a" => 5, "b" => 10, "c" => 15]);

julia> dequeue_pair!(p)
"a" => 5

@hdavid16
Copy link

It depends on the ordering direction (Forward or Reverse). The default is Forward, meaning the lowest value has the highest priority.

@i9e1
Copy link

i9e1 commented Aug 10, 2023

!close

This can be closed as the documentation (now) clearly states that default ordering is min (Forward).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants