20 lines
352 B
Go
20 lines
352 B
Go
package heap
|
|
|
|
import (
|
|
"474420502.top/eson/structure/compare"
|
|
"474420502.top/eson/structure/sparse_array/array3"
|
|
)
|
|
|
|
type Heap struct {
|
|
size int
|
|
cap int
|
|
elements *array3.Array3
|
|
Compare compare.Compare
|
|
}
|
|
|
|
func New(Compare compare.Compare) *Heap {
|
|
h := &Heap{Compare: Compare, cap: 8}
|
|
h.elements = array3.NewWithCap(4, 4, 4)
|
|
return h
|
|
}
|