添加了树的接口

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 avlkey
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 {
@@ -35,6 +37,10 @@ func New(Compare compare.Compare) *Tree {
return &Tree{Compare: Compare, iter: NewIteratorWithCap(nil, 16)}
}
func assertImplementation() {
var _ tree.IBSTreeKey = (*Tree)(nil)
}
func (tree *Tree) String() string {
if tree.size == 0 {
return ""