Skip to content

vedhavyas/min-binary-heap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

heap

-- import "github.com/vedhavyas/min-binary-heap"

Usage

type Heap

type Heap struct {
}

Heap represents Minimum Binary Heap

func New

func New() *Heap

New returns a new Minimum Binary Heap data structure

func (*Heap) Len

func (h *Heap) Len() int

Len returns the total size of Heap

func (*Heap) Pop

func (h *Heap) Pop() interface{}

Pop returns the value with lowest priority if multiple values with same priority exists, will pop one of them

func (*Heap) Push

func (h *Heap) Push(priority int, key interface{})

Push takes a key and its priority and adds to the heap

About

Minimum Binary Heap implementation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages