We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 115e428 commit 54987d1Copy full SHA for 54987d1
src/data-structures/tree/binary-search-tree/BinarySearchTreeNode.js
@@ -110,7 +110,7 @@ export default class BinarySearchTreeNode extends BinaryTreeNode {
110
// Find the next biggest value (minimum value in the right branch)
111
// and replace current value node with that next biggest value.
112
const nextBiggerNode = nodeToRemove.right.findMin();
113
- if (!this.nodeComparator.equal(nextBiggerNode, nodeToRemove.right)) {
+ if (!this.nodeValueComparator.equal(nextBiggerNode, nodeToRemove.right)) {
114
this.remove(nextBiggerNode.value);
115
nodeToRemove.setValue(nextBiggerNode.value);
116
} else {
0 commit comments