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

Function getHeight

javascript/0110-balanced-binary-tree.js:32–37  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

30};
31
32const getHeight = (root) => {
33 const isBaseCase = root === null;
34 if (isBaseCase) return 0;
35
36 return dfs(root);
37};
38
39var dfs = (root) => {
40 const left = getHeight(root.left);

Callers 2

isAcceptableHeightFunction · 0.70
dfsFunction · 0.70

Calls 1

dfsFunction · 0.70

Tested by

no test coverage detected