* Get the height of the tree. * @return {number} The height of the tree.
()
| 29 | * @return {number} The height of the tree. |
| 30 | */ |
| 31 | height(): number { |
| 32 | if (!this.root) { |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | return this.root.height(); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Traverse the tree in an in-order fashion. |
no outgoing calls