MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / serialize

Function serialize

javascript/0297-serialize-and-deserialize-binary-tree.js:8–12  ·  view source on GitHub ↗
(root, result = [])

Source from the content-addressed store, hash-verified

6 * @return {string}
7 */
8var serialize = function (root, result = []) {
9 serial(root, result);
10
11 return result;
12};
13
14const serial = (root, result) => {
15 const isBase = root === null;

Callers

nothing calls this directly

Calls 2

serialFunction · 0.85
dfsSerializeIterativeFunction · 0.85

Tested by

no test coverage detected