This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this package is mostly copy-pasted from golang's std container/heap | |
// I changed Interface, Pop and Push in order to get rid of type assertions | |
// usage can be found in test file, benchmarks show that we can get about 27% of speedup for 1000 elems, or 10% for 10M elems (tested on go1.4) | |
package gheap | |
type Interface interface { | |
Len() int | |
Less(i, j int) bool | |
Swap(i, j int) | |
} |