Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.
Example 1:
Note:
The range of node's value is in the range of 32-bit signed integer.
解法1:
一个bfs解决问题。
要注意的是当中的加和可能会overflow,要用long。
C++
Java