The relationship between the number of edges and the number of trees in a forest node

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.