Published: 06 Mar 2017 › Updated: 06 Mar 2017![[LeetCode] Maximum Depth of Binary Tree in Objective C](/nhc-explorer-cover.webp)
![[LeetCode] Maximum Depth of Binary Tree in Objective C](/nhc-explorer-cover.webp)
[LeetCode] Maximum Depth of Binary Tree in Objective C
LeetCode: Maximum Depth of Binary Tree in Objective C
typedef struct {
int value;
struct TreeNode *left;
struct TreeNode *right;
} TreeNode;
- (int)maximumDepth:(TreeNode *)node
{
if (!node) return 0;
return MAX(maximumDepth(node.left), maximumDepth(node.right)) + 1;
}
Leave [LeetCode] Maximum Depth of Binary Tree in Objective C to:
Read more #programming posts
Best Posts From nbfuhao
We have not curated any of nbfuhao's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From nbfuhao
- [LeetCode] Objective C — Reverse a NSString
- [LeetCode] Objective C — Check If a String Has Duplicate Characters
- [LeetCode] Convert Sorted Array to Binary Search Tree in Objective C
- [LeetCode] Validate Binary Search Tree in Objective C
- [LeetCode] Balanced Binary Tree in Objective C
- [LeetCode] Maximum Depth of Binary Tree in Objective C
- [LeetCode] Binary Tree Level Order Traversal in Objective C
- [LeetCode] Binary Tree Preorder Traversal in Objective C