emirpasic 6 years ago
parent 17852f48a5
commit 370f7ab252

@ -64,6 +64,8 @@ func NewWithStringComparator() *Tree {
func (tree *Tree) Put(key interface{}, value interface{}) {
var insertedNode *Node
if tree.Root == nil {
// Assert key is of comparator's type for initial tree
tree.Comparator(key, key)
tree.Root = &Node{Key: key, Value: value, color: red}
insertedNode = tree.Root
} else {

Loading…
Cancel
Save