Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 699fd82

Browse files
committed
update: aded info for clarity
1 parent bcad3b6 commit 699fd82

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/_DataStructures_/Trees/BST/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ class BinarySearchTree {
104104
// there is a left sub-tree
105105
return root.leftChild;
106106
}
107-
// the root contain 2 childs
107+
/**
108+
* the root contain 2 childs, we got 2 options:
109+
* 1. We can either find the Node with minimum value at from the right sub-tree
110+
* 2. Or, we can find the Node with maximum value from the left sub-tree
111+
*
112+
* I'm picking up 1 here
113+
*/
108114
const minRightNode = this.findMinNode(root.rightChild);
109115
// eslint-disable-next-line no-param-reassign
110116
root.value = minRightNode.value;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /