Skip to content

Clarify priority in PriorityQueue #698

Closed

Description

@dpsanders

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

Activity

  1. dpsanders commented on Nov 4, 2020

    @dpsanders
    ContributorAuthor

    It seems to be the smallest priority:

    julia> p = PriorityQueue(["a" => 5, "b" => 10, "c" => 15]);
    
    julia> dequeue_pair!(p)
    "a" => 5
  2. hdavid16 commented on Apr 28, 2023

    @hdavid16

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

  3. i9e1 commented on Aug 10, 2023

    @i9e1

    !close

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

  4. nsajko commented on Oct 4, 2026

    @nsajko
    Member

    closing per above

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions