Average Of Leveles In Binary Tree
Average Of Leveles In Binary Tree

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:

  1. The range of node’s value is in the range of 32-bit signed integer.

Approach 1 : Using Classical BFS
Here we used Queue with Poll and Offer function for managing the queue.