@@ -63,7 +63,7 @@ const { BinarySearchTree, AvlTree } = require('@datastructures-js/binary-search-
63
63
import { BinarySearchTree , AvlTree } from ' @datastructures-js/binary-search-tree' ;
64
64
```
65
65
66
- ### Create a Tree
66
+ ### Construction
67
67
68
68
``` js
69
69
const bst = new BinarySearchTree ();
@@ -85,7 +85,7 @@ inserts a node with key/value into the tree. Inserting an node with existing key
85
85
</table >
86
86
87
87
<table >
88
- <tr ><th colspan =" 2 " >return</th ></tr >
88
+ <tr ><th colspan =" 2 " align = " center " >return</th ></tr >
89
89
<tr ><td >BinarySearchTree</td ><td ><a href =" #binarysearchtreenode " >BinarySearchTreeNode</a ></td ></tr >
90
90
<tr ><td >AvlTree</td ><td ><a href =" #avltreenode " >AvlTreeNode</a ></td ></tr >
91
91
</table >
@@ -151,7 +151,7 @@ finds a node in the tree by its key.
151
151
</table >
152
152
153
153
<table >
154
- <tr ><th colspan =" 2 " >return</th ></tr >
154
+ <tr ><th align = " center " colspan =" 2 " >return</th ></tr >
155
155
<tr ><td >BinarySearchTree</td ><td ><a href =" #binarysearchtreenode " >BinarySearchTreeNode</a ></td ></tr >
156
156
<tr ><td >AvlTree</td ><td ><a href =" #avltreenode " >AvlTreeNode</a ></td ></tr >
157
157
</table >
@@ -179,7 +179,7 @@ console.log(bst.find(100)); // null
179
179
finds the node with min key in the tree.
180
180
181
181
<table >
182
- <tr ><th colspan =" 2 " >return</th ></tr >
182
+ <tr ><th align = " center " colspan =" 2 " >return</th ></tr >
183
183
<tr ><td >BinarySearchTree</td ><td ><a href =" #binarysearchtreenode " >BinarySearchTreeNode</a ></td ></tr >
184
184
<tr ><td >AvlTree</td ><td ><a href =" #avltreenode " >AvlTreeNode</a ></td ></tr >
185
185
</table >
@@ -205,7 +205,7 @@ console.log(min.getValue()); // v7
205
205
finds the node with max key in the tree.
206
206
207
207
<table >
208
- <tr ><th colspan =" 2 " >return</th ></tr >
208
+ <tr ><th align = " center " colspan =" 2 " >return</th ></tr >
209
209
<tr ><td >BinarySearchTree</td ><td ><a href =" #binarysearchtreenode " >BinarySearchTreeNode</a ></td ></tr >
210
210
<tr ><td >AvlTree</td ><td ><a href =" #avltreenode " >AvlTreeNode</a ></td ></tr >
211
211
</table >
@@ -230,7 +230,7 @@ console.log(max.getValue()); // v4
230
230
returns the root node of the tree.
231
231
232
232
<table >
233
- <tr ><th colspan =" 2 " >return</th ></tr >
233
+ <tr ><th align = " center " colspan =" 2 " >return</th ></tr >
234
234
<tr ><td >BinarySearchTree</td ><td ><a href =" #binarysearchtreenode " >BinarySearchTreeNode</a ></td ></tr >
235
235
<tr ><td >AvlTree</td ><td ><a href =" #avltreenode " >AvlTreeNode</a ></td ></tr >
236
236
</table >
@@ -460,7 +460,7 @@ returns the value that is associated with a node.
460
460
returns node's left child node.
461
461
462
462
<table >
463
- <tr ><th colspan =" 2 " >return</th ></tr >
463
+ <tr ><th align = " center " colspan =" 2 " >return</th ></tr >
464
464
<tr ><td >BinarySearchTree</td ><td ><a href =" #binarysearchtreenode " >BinarySearchTreeNode</a ></td ></tr >
465
465
<tr ><td >AvlTree</td ><td ><a href =" #avltreenode " >AvlTreeNode</a ></td ></tr >
466
466
</table >
@@ -469,7 +469,7 @@ returns node's left child node.
469
469
returns node's right child node.
470
470
471
471
<table >
472
- <tr ><th colspan =" 2 " >return</th ></tr >
472
+ <tr ><th align = " center " colspan =" 2 " >return</th ></tr >
473
473
<tr ><td >BinarySearchTree</td ><td ><a href =" #binarysearchtreenode " >BinarySearchTreeNode</a ></td ></tr >
474
474
<tr ><td >AvlTree</td ><td ><a href =" #avltreenode " >AvlTreeNode</a ></td ></tr >
475
475
</table >
@@ -478,7 +478,7 @@ returns node's right child node.
478
478
returns node's parent node.
479
479
480
480
<table >
481
- <tr ><th colspan =" 2 " >return</th ></tr >
481
+ <tr ><th align = " center " colspan =" 2 " >return</th ></tr >
482
482
<tr ><td >BinarySearchTree</td ><td ><a href =" #binarysearchtreenode " >BinarySearchTreeNode</a ></td ></tr >
483
483
<tr ><td >AvlTree</td ><td ><a href =" #avltreenode " >AvlTreeNode</a ></td ></tr >
484
484
</table >
0 commit comments