| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | adamant | 152 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 144 |
| 5 | errorgorn | 141 |
| 6 | cry | 139 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
|
On
-IA- →
Help about Finding the centroid of a tree...What's the difference between these two methods?, 9 years ago
0
Can some other people help me please...?Thank you in advance... |
|
On
-IA- →
Help about Finding the centroid of a tree...What's the difference between these two methods?, 9 years ago
0
I wrote them by myself after I understood what they meant...I know it looks different by code between these two method...but I think the main idea is similar,more concretely...the first code is to find a vertex that after delete it,the size of the max substree of the whole tree is as small as possible(as I mentioned after the code...) Oh maybe I didn't explain the meaning of the second code,sorry... The second method is found at the grandmaster who took the first place in that contest,and I think the main idea is finding the centroid in the process of continues searching in the substree whose size is larger than half of the tree(aka. n/2).When it stop and return the original parameters from the dfs itself,it is just the centroid because it has no substree whose size is larger than n/2,according to the definition of the centroid of a tree:after deleting it from the whole tree,the max size of substree is as small as possible ,as my friend tell me that if take a centroid as root,the max size of subtree is half the whole tree(n/2).And I think the main idea of these two code are similar...but I got different judgement(also the figure is large so I couldn't realize the difference by this...) |
|
On
-IA- →
Help about Finding the centroid of a tree...What's the difference between these two methods?, 9 years ago
0
Auto comment: topic has been updated by -IA- (previous revision, new revision, compare). |
| Name |
|---|


