The only way I (emphasis on the 'I') can make this example work is if I take diameter to mean "the maximum number of edges in the longest trip between any two nodes". Then, I can exclude 01235, giving me 23 sub-trees. But I'm talking edges, and that doesn't seem to be right.
If I take diameter to mean "the maximum number of vertices in the longest trip between any two nodes", then that excludes 01235, 0124, 0123, 12345, 1235, 2345, etc. which yields an answer that's too small.
If I take diameter to mean "the longest number of vertices between two leaf nodes while choosing the best root", then I can't exclude any. e.g. 12345 can be 5 as root thus the diameter is between 124 and is kept. e.g. 01235 with 0 as root has only one leaf and is kept. e.g. 01234 can be 0 as root thus the diameter is between 234 and is kept.
If I take diameter to mean "the longest number of vertices between two leaf nodes while choosing the worst root", then that excludes 01234, 12345 which yields and answer that's too small by one.
So, what now?