Skip to content

container/heap: docs do not clearly state that element 0 is minimum element #5577

@ianlancetaylor

Description

@ianlancetaylor
I believe the implementation of container/heap implies that the 0 element is always the
minimum element.  Thus you can always peek at the minimum element without actually
popping it by simply looking at h[0].  But the docs don't actually state this, and there
is no Top method that lets you look at the minimum element without removing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions