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

  • 0

    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.

  • 0

    I would submit that the root can be a leaf, but since it is not left of anything, it can't be a left leaf

Log in to reply

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