structure/heap/heap.go

20 lines
352 B
Go
Raw Normal View History

2019-04-11 13:34:50 +00:00
package heap
import (
"474420502.top/eson/structure/compare"
"474420502.top/eson/structure/sparse_array/array3"
2019-04-11 13:34:50 +00:00
)
type Heap struct {
size int
cap int
elements *array3.Array3
2019-04-11 13:34:50 +00:00
Compare compare.Compare
}
func New(Compare compare.Compare) *Heap {
h := &Heap{Compare: Compare, cap: 8}
h.elements = array3.NewWithCap(4, 4, 4)
return h
2019-04-11 13:34:50 +00:00
}