【leetcode】N叉树的最大深度

int maxDepth(struct Node* root){
    if(!root) return 0;
    int max = 0;
    for(int i = 0; i < root->numChildren; ++i){
        int temp = maxDepth(root->children[i]);
        max = max > temp ? max : temp;
    }
    return max + 1;
}
原文地址:https://www.cnblogs.com/ganxiang/p/13698722.html