(val)
| 22 | |
| 23 | // Search the tree for a value |
| 24 | search(val) { |
| 25 | if (this.value === val) { |
| 26 | return this |
| 27 | } else if (val < this.value && this.left !== null) { |
| 28 | return this.left.search(val) |
| 29 | } else if (val > this.value && this.right !== null) { |
| 30 | return this.right.search(val) |
| 31 | } |
| 32 | return null |
| 33 | } |
| 34 | |
| 35 | // Visit a node |
| 36 | visit(output = (value) => console.log(value)) { |
no outgoing calls
no test coverage detected