One method would be to list all the possible trees systematically by looking at the highest degree of a vertex.

If there is a vertex of degree five then the tree must look like this:

At the opposite extreme, if the highest vertex degree is two then the tree must look like this:Code:o | o – o – o / \ o o

The intermediate cases, where the highest vertex degree is three or four, take a bit more thought, but are not too hard. (Hint: there's only one possibility for the degree four case, but three different graphs in the degree three case.)Code:o – o – o – o – o – o