Skip to content

container/heap: avoid use of the term "heap invariants" #65492

@codesoap

Description

@codesoap

Go version

go version go1.21.1 openbsd/amd64

Issue

In the documentation of the Init function as well as the Interface interface and within the PriorityQueue example the term "heap invariants" is used. Maybe it is because I lack the academic background, but the term confused me when trying to understand the purpose of the Init function.

After some further reading I now understand, that it basically just means that the Init function establishes a correctly "sorted" heap from an "unsorted" input. I assume, that "sorting" is not the correct term to use and "establishing invariants" is a formally correct way to describe what Init does. However, I feel like easier language could be used to describe the function of Init and thus ease the understanding of the package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions