MCPcopy Create free account
hub / github.com/betomoedano/JavaScript-Coding-Interview-Questions / node-depths.js

File node-depths.js

binary-trees/node-depths.js:None–None  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1// function nodeDepths(root, depth = 0) {
2// if (root === null) return 0;
3// return (
4// depth + nodeDepths(root.left, depth + 1) + nodeDepths(root.right, depth + 1)

Callers

nothing calls this directly

Calls 1

nodeDepthsFunction · 0.85

Tested by

no test coverage detected