Constructor
new Node(key, val, left, right)
Represents a BST node.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The lookup key. |
val |
mixed | The associated data. |
left |
Node | The left subtree. |
right |
Node | The right subtree. |
Methods
height() → {Number}
NumberNumberReturns the height of node (i.e. distance from itself to the deepest leaf in the BST)
Returns:
The height of the node
- Type
- Number