java-algorithms-implementation icon indicating copy to clipboard operation
java-algorithms-implementation copied to clipboard

tip about method BinarySearchTree.replaceNodeWithNode()

Open zzuklj opened this issue 5 years ago • 0 comments

https://github.com/phishman3579/java-algorithms-implementation/blob/356dfb1daff89b983194c192c7534fa3b3a30126/src/com/jwetherell/algorithms/data_structures/BinarySearchTree.java#L375

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;

zzuklj avatar Jan 17 '20 08:01 zzuklj