Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

proxy.golang.org : github.com/addrummond/heap

Package heap provides a generic min or max heap that can be used as a priority queue. The backing data structure is a slice denoting an implicit binary heap. The default value of Heap is a valid empty heap. The heap grows in the usual way by appending elements to the backing slice and then making adjustments to preserve the heap property. As the heap shrinks, smaller backing slices are periodically allocated and elements copied over. Empty heaps are guaranteed to be backed by nil slices. If your type can be compared using the < operator then you can use the Push and Pop functions to manipulate the heap, e.g.: If your type can't be compared using < then you can implement the Cmp method of the Orderable interface for your type (with a pointer receiver) and use the PushOrderable and PopOrderable functions:

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/addrummond/heap
Keywords: data-structures, generic, golang, golang-library, heap
License: MIT
Latest release: 5 months ago
First release: 9 months ago
Namespace: github.com/addrummond
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 12 days ago

    Loading...
    Readme
    Loading...