Skip to content
RED SAG Skills
hard20 pts · first answer countsgraphstreesdfs

Sum of distances from every node

For each node in a tree of 10^5 nodes, you need the sum of distances to all other nodes. What is the efficient method?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions