Also, if the tree is two vertices connected by an edge, does the root count as a leaf too? Since it's also a vertex of degree one?
I've had trouble clarifying this online and from my textbook. Thank you.
Also, if the tree is two vertices connected by an edge, does the root count as a leaf too? Since it's also a vertex of degree one?
I've had trouble clarifying this online and from my textbook. Thank you.
For the former: yes, by most definitions, the one-vertex, zero-edge graph is a tree.
For the latter: yes, all vertices of degree 1 are leaves. In general, which node you call the "root" is pretty much arbitrary.