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 6b9a4e8

Browse files
fix(bst): some typos on the code
1 parent 3c32d0e commit 6b9a4e8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎src/data-structures/trees/binary-search-tree.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ class BinarySearchTree {
249249
/**
250250
* Represent Binary Tree as an array.
251251
*
252-
* Leaf nodes will have two `undefined` descendents.
252+
* Leaf nodes will have two `undefined` descendants.
253253
*
254254
* The array representation of the binary tree is as follows:
255255
*
256256
* First element (index=0) is the root.
257-
* The following two elements (index=1,2) are descendents of the root: left (a) and right (b).
258-
* The next two elements (index=3,4) are the descendents of a
259-
* The next two elements (index=5,6) are the descendents of b and so on.
257+
* The following two elements (index=1,2) are descendants of the root: left (a) and right (b).
258+
* The next two elements (index=3,4) are the descendants of a
259+
* The next two elements (index=5,6) are the descendants of b and so on.
260260
*
261261
* 0 1 2 3 4 5 6 n
262262
* [root, a=root.left, b=root.right, a.left, a.right, b.left, b.right, ...]

‎src/data-structures/trees/binary-tree-node.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BinaryTreeNode {
1919

2020
// tag::setAndUpdateParent[]
2121
/**
22-
* Set a left node descendents.
22+
* Set a left node descendants.
2323
* Also, children get associated to parent.
2424
*/
2525
setLeftAndUpdateParent(node) {
@@ -31,7 +31,7 @@ class BinaryTreeNode {
3131
}
3232

3333
/**
34-
* Set a right node descendents.
34+
* Set a right node descendants.
3535
* Also, children get associated to parent.
3636
*/
3737
setRightAndUpdateParent(node) {
@@ -71,7 +71,7 @@ class BinaryTreeNode {
7171
}
7272

7373
/**
74-
* Node is leaf is it has no descendents
74+
* Node is leaf is it has no descendants
7575
*/
7676
get isLeaf() {
7777
return !this.left && !this.right;

0 commit comments

Comments
(0)

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