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

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/twmb/go-mmheap

Package mmheap provides a drop-in min-max heap for any type that implements heap.Interface. In a min-max heap, the minimum element is at the root at index 0, and the maximum element is in one of the two root children. Thus, a min-max heap provides an efficient way to access either the minimum or maximum elements in a set in O(1) time. Due to the increased number of comparisons to implement a min-heap, its runtime is slower than a general heap (in this implementation, just under 2x). Because of this, unless you need to continually access both the minimum and maximum elements, it may be beneficial to use a different data structure. Even if you do need to continually access the minimum or maximum, a different data structure may be better. This package exists for anybody looking, but I recommend benchmarking this against github.com/google/btree. Generally, a btree is a good and fast data structure for quickly accessing min and max elements. However, a key benefit of heap or mmheap is the ability to change or modify elements and fix their position in the tree. For more information about a min-max heap, read the following paper: Since this package is identical to the stdlib's container/heap documentation, it is elided here.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/twmb/go-mmheap
License: MIT
Latest release: over 5 years ago
First release: over 5 years ago
Namespace: github.com/twmb
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 7 days ago

    Loading...
    Readme
    Loading...