Documentation
¶
Index ¶
Constants ¶
View Source
const Version = "0.0.1"
Version The main version number that is being run at the moment.
Variables ¶
This section is empty.
Functions ¶
func IntComparator ¶
func IntComparator(a, b interface{}) int
IntComparator provides a basic comparison on int
func StringComparator ¶
func StringComparator(a, b interface{}) int
StringComparator provides a fast comparison on strings
Types ¶
type Comparator ¶
type Comparator func(a, b interface{}) int
Comparator will make type assertion (see IntComparator for example), which will panic if a or b are not of the asserted type.
Should return a number:
negative , if a < b zero , if a == b positive , if a > b
type Interface ¶
type Interface interface { // Inserts an element to the heap and returns it Insert(v interface{}) interface{} // DeleteMin deletes and returns the smallest element DeleteMin() interface{} // FindMin returns the minimum element FindMin() interface{} // Removes all items Clear() }
Interface is basic interface that all Heaps implement.
Click to show internal directories.
Click to hide internal directories.