blinkshot's blog

By blinkshot, history, 5 years ago, In English

I got stuck in this question . This is the question — "You are given a tree consisting of n nodes. Your task is to determine for each node the sum of the distances from the node to all other nodes."

Any help in understanding how to apply dp here will be much appreciated.

Full text and comments »

  • Vote: I like it
  • -9
  • Vote: I do not like it