Skip to content

Should return the same node when we add a duplicated node #99

Closed
@jemmali-git

Description

@jemmali-git

As the title of this issue mention you need to add one line of code, otherwise all the nodes we be removed

if (found) { // duplicated: value already exist on the tree
        found.meta.multiplicity = (found.meta.multiplicity || 1) + 1; // <2>
        newNode = found; // new line to add
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions