MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / maxDepth

Function maxDepth

CPP/Trees/Max_Depth_BinaryTree.cpp:21–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21int maxDepth(TreeNode* root) {
22 if(root == NULL)
23 return 0;
24
25 if(root->left == NULL && root->right == NULL)
26 return 1;
27
28 return solve(root->left, root->right, 2);
29}

Callers

nothing calls this directly

Calls 1

solveFunction · 0.70

Tested by

no test coverage detected