As in the previous problem, you are given a binary tree T = (V, E) with designated root node. In addition, there is an array x[.] with a value for each node in V. Define a new array z[.] as follows: for each u ∈ V,
z[u] = the maximum of the x-values associated with u’s descendants.
Give a linear-time algorithm which calculates the entire z-array.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.