20 lines
265 B
C
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;
|
|
}
|