File tree Expand file tree Collapse file tree
core-java/src/main/java/com/baeldung/tree Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments