In HOLI-Spoj problem(discussed in the video tutorial) how to calculate number of nodes in a subtree of a node.
If we perform DFS it will calculate the entire number of nodes in that graph . But according to the question one needs to calculate number of nodes in a sub tree.