(root, result)
| 12 | }; |
| 13 | |
| 14 | const serial = (root, result) => { |
| 15 | const isBase = root === null; |
| 16 | if (isBase) return result.push(null); |
| 17 | |
| 18 | dfsSerialize(root, result); |
| 19 | }; |
| 20 | |
| 21 | const dfsSerialize = (node, result) => { |
| 22 | result.push(node.val); |
no test coverage detected