MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / minDepth

Function minDepth

JavaScript/111-minimum-depth-of-binary-tree.js:25–29  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

23
24
25var minDepth = function(root) {
26 if(root) {
27 return traversal(root, 1);
28 } else { return 0 }
29};
30
31// traversal of the tree is recursive to ensure travel down
32// both the right and left children nodes

Callers

nothing calls this directly

Calls 1

traversalFunction · 0.85

Tested by

no test coverage detected