phishman3579 / java-algorithms-implementation

Algorithms and Data Structures implemented in Java

Repository from Github https://github.comphishman3579/java-algorithms-implementationRepository from Github https://github.comphishman3579/java-algorithms-implementation

tip about method BinarySearchTree.replaceNodeWithNode()

zzuklj opened this issue · 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;