fix some bug and add cap method to array
This commit is contained in:
@@ -2,15 +2,18 @@ package heap
|
||||
|
||||
import (
|
||||
"474420502.top/eson/structure/compare"
|
||||
"474420502.top/eson/structure/sparse_array/array3"
|
||||
)
|
||||
|
||||
type Heap struct {
|
||||
size int
|
||||
cap int
|
||||
elements []interface{}
|
||||
elements *array3.Array3
|
||||
Compare compare.Compare
|
||||
}
|
||||
|
||||
func New(Compare compare.Compare) *Heap {
|
||||
return &Heap{Compare: Compare, cap: 8}
|
||||
h := &Heap{Compare: Compare, cap: 8}
|
||||
h.elements = array3.NewWithCap(4, 4, 4)
|
||||
return h
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user