Why root can't be leaf in single element tree?


  • 0
    M

    This case is not mentioned in task description and AFAIK there is no rule to treat single node tree as tree with no leaves. Why root element can't be left leaf?

    Discrete Mathematics and Its Applications - 7th edition By Rosen says:
    Vertices that have children are called internal vertices. The root is an internal vertex unless it is the only vertex in the graph, in which case it is a leaf.


Log in to reply
 

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