Sir, In question, it is asked about a tree, not a binary tree. binary tree is rooted and ordered.
It is a well-known Cayley's formula to find total number of possible trees if vertices are labeled. In case of rooted trees , this formula becomes $n^{n-2} * n = n^{n-1}$ because any of the n vertices can be selected as a root.
I am attaching the screenshot from the Graph Theory book by Narsingh Deo.
PFA.
https://en.wikipedia.org/wiki/Cayley's_formula