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

Function dfs

javascript/0102-binary-tree-level-order-traversal.js:53–58  ·  view source on GitHub ↗
(root, level, levels)

Source from the content-addressed store, hash-verified

51};
52
53const dfs = (root, level, levels) => {
54 if (root.left) levelOrder(root.left, level + 1, levels);
55 if (root.right) levelOrder(root.right, level + 1, levels);
56
57 return levels;
58};

Callers 1

levelOrderFunction · 0.70

Calls 1

levelOrderFunction · 0.70

Tested by

no test coverage detected