When the whole tree has only a root, should we sum its value?


  • 0
    M

    According to Wikipedia, a root node is considered external if it has no children. That means it is considered a leaf node as well. So shouldn't we include it when calculating the sum of left leaves?


  • 0

    It's left of what?


  • 0
    M

    You have a point. I was thinking that a leaf node without a sibling is considered a left node but I guess that's not correct


Log in to reply
 

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