Skip to content

Node value is not updated when removing node in binarySearchTree.js #29

@abhvsn

Description

@abhvsn

Remove method with 2 children in binarySearchTree.js is basically updating the key but value still remains the same as the node which needs to be removed is this intended? Check the following snippet

const minRight = this.min(node.getRight());
node.setKey(minRight.getKey());
return this.remove(minRight.getKey(), minRight);

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions