Skip to content

Slightly more user-friendly heap on top of containers/heap

License

Notifications You must be signed in to change notification settings

mailgun/minheap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is deprecated, Renamed to PriorityQueue and moved to http://github.com/mailgun/holster

Build Status

minheap

Slightly more user-friendly heap on top of containers/heap.

import "github.com/mailgun/minheap"
	

func toEl(i int) interface{} {
	return &i
}

func fromEl(i interface{}) int {
	return *(i.(*int))
}

mh := minheap.NewMinHeap()

el := &minheap.Element{
   Value:    toEl(1),
   Priority: 5,
}

mh.PushEl(el)
mh.PeekEl()
mh.Len()
mh.PopEl()

About

Slightly more user-friendly heap on top of containers/heap

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages