Answer the Following Question :
The path length of a tree T is the sum of the depths of all the nodes in T. Describe a linear-time method for computing the path length of a tree T (which is not necessarily binary)
pathLength(tree T, Node v, int d): if v is a leaf node: return d else: currDepth = d for each child c of v: currDepth = currDepth + pathLength(T,c,currDepth+1) return currDepth getResult(tree T): return pathLength(T,T.root,0)