Consider below questions.
- How many spanning trees can be there in a complete graph with n vertices?
- How many labelled Trees (please note trees, not binary trees) can be there with n vertices?
The answer is same for both questions.
For n = 2, there is 1 tree.
For n = 3, there are 3 trees.
For n = 4, there are 16 trees
The formula states that for a positive integer n, the number of trees on n labeled vertices is nn-2
Source:
https://en.wikipedia.org/wiki/Cayley%27s_formula
This article is contributed by Vaibhav Gupta. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Recommended Posts:
- GFact 22 | (2^x + 1 and Prime)
- GFact 23 | (Brocard’s problem)
- G-Fact 18 | Finding nth Fibonacci Number using Golden Ratio
- What is Cicada 3301?
- What is Bluejacking?
- Interesting and Cool Tricks in Java
- How to Install and Configure MongoDB in Ubuntu?
- Interesting Facts About Perl
- 10 Interesting Facts About Computers
- Interesting Facts about DBMS
- Facts and Question related to Style of writing programs in C/C++
- Dilworth's Theorem
- Storage of integer and character values in C
- Vantieghems Theorem for Primality Test


