Skip to content

Commit 9598456

Browse files
committed
refactor
1 parent 7acbc79 commit 9598456

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core-java/src/main/java/com/baeldung/tree/BinaryTree.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private Node deleteRecursive(Node current, int value) {
8282
}
8383

8484
// Case 3: 2 children
85-
int smallestValue = findSmallestNode(current.right);
85+
int smallestValue = findSmallestValue(current.right);
8686
current.value = smallestValue;
8787
current.right = deleteRecursive(current.right, smallestValue);
8888
return current;
@@ -96,13 +96,13 @@ private Node deleteRecursive(Node current, int value) {
9696
}
9797
}
9898

99-
private int findSmallestNode(Node root) {
99+
private int findSmallestValue(Node root) {
100100

101101
if (root.left == null) {
102102
return root.value;
103103
}
104104

105-
return findSmallestNode(root.left);
105+
return findSmallestValue(root.left);
106106
}
107107

108108
public void traverseInOrder(Node node) {

0 commit comments

Comments
 (0)