104. Maximum Depth of Binary Tre

2018-03-22  本文已影响2人  安东可

104

[思路:]

    int maxDepth(TreeNode* root) {
        if (!root) return 0;
        return max(maxDepth(root->left), maxDepth(root->right)) + 1;
    }
上一篇 下一篇

猜你喜欢

热点阅读