leetcode/104.c
2024-09-08 14:39:20 +08:00

20 lines
265 B
C

#include "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;
}