phishman3579/java-algorithms-implementation

tip about method BinarySearchTree.replaceNodeWithNode()

zzuklj opened this issue · 0 comments

this code is not wrong. I wonder can you modify it.
in my opinion, replacementNode must be a leaf node.
so if it is a left leaf node or a right leaf node,
just make sure replacementParent.lesser = null; or replacementParent.greater= null;