添加了树的接口

This commit is contained in:
2019-07-29 02:18:22 +08:00
parent 4a58bd283e
commit 3ade1566c2
10 changed files with 94 additions and 21 deletions

View File

@@ -1,8 +1,10 @@
package avldup
import (
"github.com/474420502/focus/compare"
"github.com/davecgh/go-spew/spew"
"github.com/474420502/focus/compare"
"github.com/474420502/focus/tree"
)
type Node struct {
@@ -32,6 +34,10 @@ type Tree struct {
iter *Iterator
}
func assertImplementation() {
var _ tree.IBSTree = (*Tree)(nil)
}
func New(Compare compare.Compare) *Tree {
return &Tree{Compare: Compare, iter: NewIteratorWithCap(nil, 16)}
}