Algorithm · Amazon · Medium
Problem Starting with a binary tree whose root is root, determine the mean node value at every depth by traversing the tree level by level with BFS. Report these means in order, beginning at the root and ending at the lowest populated depth. For any level containing k nodes, calculate its mean by dividing that level's value total by k. Print the mean for every level as a floating-point value. Input (stdin) The tree arrives as a level-order array representation; null marks an…
Checking your access…