Files
leetcode/src/104.c
2024-09-16 08:55:16 +08:00

20 lines
257 B
C

#include "TreeNode.h"
int max(const int a, const int b)
{
return a > b ? a : b;
}
int maxDepth(struct TreeNode *root)
{
if (!root)
return 0;
return max(maxDepth(root->left), maxDepth(root->right)) + 1;
}
int main()
{
return 0;
}