Skip to content

Proposal: heap enhancements #9

Closed

Description

@kmsquire

There are a couple of enhancements that may make heaps in this package more useful:

  1. Allow the user to specify an Ordering (as is used by the Sort machinery in Base).
  2. Make key-value pair storage possible/easy

The second proposal could be made possible by a specific Ordering, but would be more efficient if it were coded for in the data structure.

It may make sense to code these as separate data structures (I haven't looked at the code), implementing the AbstractHeap interface if that makes sense.

Activity

  1. wsliang commented on May 9, 2014

    @wsliang
    Contributor

    What's the relationship between the heaps in this package and the PriorityQueue / heap* operations in Base.Collections? They seem to have more or less the same functionality.

  2. oxinabox commented on Oct 31, 2017

    @oxinabox
    Member

    The first is basically covered by / overlaps with #243

  3. nsajko commented on Oct 1, 2026

    @nsajko
    Member

    The first proposal is implemented nowadays: both BinaryHeap and MutableBinaryHeap depend on Ordering.

    The second proposal is not clear and does not feel actionable.

    Closing.

  4. nsajko commented on Oct 1, 2026

    @nsajko
    Member

    PriorityQueue also depends on Ordering, and explicitly stores both keys and values. So both proposals are, in fact, implemented.

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