# Definition of a leaf in a tree

Across two different texts, I have seen two different definitions of a leaf

1) a leaf is a node in a tree with degree 1

2) a leaf is a node in a tree with no children

The problem that I see with def #2 is that if the graph is not rooted, it might not be clear whether a node, n, has adjacent nodes that are its children or its parents

So is it just always safer to go with def #1? Or is def #2 restricted to rooted trees? Why do some authors present these definition differently?

• #2 is restricted to rooted trees, yes. The idea of children of vertices requires a root. Jul 16, 2019 at 21:41

Let's look at an unrooted tree with two nodes $v_{1}, v_{2}$. Either could be the root, but both are leaves.
Now consider $P_{2}$, a path of length $2$, which has $3$ vertices. Only the middle vertex is not a leaf. If one of the endpoints was selected as the root, it would have exactly child. If the middle vertex was selected, it would be a root that was not a leaf.