C# recursion


  • 0
    L

    public int MaxDepth(TreeNode node) {
    if(node != null)
    {
    return Math.Max(MaxDepth(node.left), MaxDepth(node.right)) + 1;
    }
    return 0;
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.