find multiplication of sums of data of leaves at same level.
Answers
Answered by
0
Answer:
One Simple Solution is to recursively compute leaf sum for all level starting from top to bottom. Then multiply sums of levels which have leaves. Time complexity of this solution would be O(n2). An Efficient Solution is to use Queue based level order traversal.
Similar questions