If you look at binary trees, then, as mcdowella said, choosing (2n, n) / (n + 1) (Catalan number) is the answer.
If you look at arbitrary trees, then this is probably n. n ^ (n-2) = n ^ (n-1), but I'm not quite sure. Prufer algo tells us that there are n ^ (n-2) labeled trees, and any of the nodes can be made root, so we get the number n ^ (n-1).
source
share