(val)
| 126 | |
| 127 | // Start by searching the root |
| 128 | search(val) { |
| 129 | if (this.root) { |
| 130 | const found = this.root.search(val) |
| 131 | if (found !== null) { |
| 132 | return found.value |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | // not found |
| 137 | return null |
| 138 | } |
| 139 | |
| 140 | // Add a new value to the tree |
| 141 | addValue(val) { |