The relationship between the number of edges and the number of trees in a forest node
@ (Algorithmic Learning)
If the forest F has 15 sides, 25 nodes. The number of trees included in F is:
A. 8 B. 9 c. 11
Analysis: The relationship between the number of trees in the forest and the node points is deduced.
Let's look at the general strategy: +1= nodes based on the number of sides of a tree.
As you can see, there are fewer nodes per tree.
That
When a tree, the number of sides = nodes-1
Two trees, number of sides = nodes-2
....
n Tree, number of edges = node-n
Then get: 25-15 = 10.
Sometimes, it is possible to focus too much on local features and not to experience macro features. But can be solved quickly with the special value: 15 side is full of a tree, then the tree has 16 nodes, the remaining 9 nodes are no longer formed edge, that is, a node counted a tree. So, a total of 1+9 = 10 trees.