go-heaps: github.com/theodesp/go-heaps Index | Files | Directories

package go_heaps

import "github.com/theodesp/go-heaps"


Package Files

doc.go heap.go version.go


const Version = "0.0.1"

Version The main version number that is being run at the moment.

type Extended Uses

type Extended interface {
    // Return the heap formed by taking the union of the item disjoint
    // current heap and a
    Meld(a Interface) Interface

    // Adjusts the key of item old in heap h to new
    Adjust(old, new Item) Item

    // Delete arbitrary item from heap h.
    Delete(item Item) Item

Extended adds operations on heaps are often useful.

type Integer Uses

type Integer int

Integer implements the Item interface

func (Integer) Compare Uses

func (a Integer) Compare(b Item) int

type Interface Uses

type Interface interface {
    // Inserts an element to the heap and returns it
    Insert(v Item) Item

    // DeleteMin deletes and returns the smallest element
    DeleteMin() Item

    // FindMin returns the minimum element
    FindMin() Item

    // Removes all items

Interface is basic interface that all Heaps implement.

type Item Uses

type Item interface {
    // Should return a number:
    //    negative , if a < b
    //    zero     , if a == b
    //    positive , if a > b
    Compare(than Item) int

Item is the basic element that is inserted in a heap

type ItemIterator Uses

type ItemIterator func(item Item) bool

ItemIterator allows callers of Do to iterate in-order over portions of the tree. When this function returns false, iteration will stop and the function will immediately return.

type String Uses

type String string

String implements the Item interface

func (String) Compare Uses

func (a String) Compare(b Item) int


binomialPackage binomial implements a Binomial heap Data structure
fibonacciPackage fibonacci implements a Fibonacci FibonacciHeap Data structure Reference: https://en.wikipedia.org/wiki/Fibonacci_heap Implementation from Introduction to Algorithms by T.
pairingPackage pairing implements a Pairing heap Data structure
skewPackage skew implements a Skew heap Data structure

Package go_heaps is imported by 11 packages. Updated 2019-05-25. Refresh now. Tools for package owners.