# The longest path in a tree

Help me demonstrate this or there is a counterexample?

Let $T(V,E)$ be a tree with $|T| \geq 2$ and a path $P{(u_0,u_1,u_2,...,u_n)}$. The longest path in a tree has $d(u_0) = d(u_n) = 1$.

• Assume this isn't true, where $d(u_0) > 1$ or $d(u_n) > 1$, then you can add at least one more to the length of the path with $P(u_{-1}, u_0, . . . , u_n)$ or $P(u_0, . . . , u_n, u_{n+1})$. – Christopher Bell II May 3 '17 at 1:29

I'm guessing that $d(v)$ is the degree of $v$, in which case this is fairly straightforward to prove. Here's some intuition: the longest path cannot end with a vertex of degree 2 or more, because then the extra neighbor could be used to lengthen the path. I'll leave the specifics of the proof to you.