Skip to content

BSTree.remove() will not remove the root node? #7

@recursion

Description

@recursion

Im not sure if this is expected behavior or not? I noticed that BSTree.remove() will not remove the node if it is the last one/root node in the tree?

assuming:

var tree = new BSTree();
// tree._count = 0

tree = tree.insert(100, 'yay');
//tree._count = 1

tree = tree.remove(100);
//tree._count = 1 (expecting 0)

It appears that the BSTree will not remove the root node once one has been added. Is this correct/expected behavior?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions