File tree 1 file changed +20
-20
lines changed
1 file changed +20
-20
lines changed Original file line number Diff line number Diff line change 1
1
'''
2
- * Programmer : Dhruv Patel
3
- * Problem Name : Average of Levels in Binary Tree
4
- * Used In : LeetCode Weekly Contest 40
5
- * Used As : Problem
6
- * Problem =>
7
- * Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.
8
- * Thoughts =>
9
- * The following code initializes the class TreeNode and implements a method averageOfLevels which takes the input of a root
10
- * and return the list of data_type Float. There are several ways which one can attack this problem. One of the naive way is to
11
- * use Breadth First Search algorithm to iterate through nodes.
12
- *
13
- * Sample Input =>
14
- * 3
15
- * / \
16
- * 9 20
17
- * / \
18
- * 15 7
19
- *
20
- * Sample Output =>
21
- * [3, 14.5, 11]
2
+ # Programmer : Dhruv Patel
3
+ # Problem Name : Average of Levels in Binary Tree
4
+ # Used In : LeetCode Weekly Contest 40
5
+ # Used As : Problem
6
+ # Problem =>
7
+ # Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.
8
+ # Thoughts =>
9
+ # The following code initializes the class TreeNode and implements a method averageOfLevels which takes the input of a root
10
+ # and return the list of data_type Float. There are several ways which one can attack this problem. One of the naive way is to
11
+ # use Breadth First Search algorithm to iterate through nodes.
12
+ #
13
+ # Sample Input =>
14
+ # 3
15
+ # / \
16
+ # 9 20
17
+ # / \
18
+ # 15 7
19
+ #
20
+ # Sample Output =>
21
+ # [3, 14.5, 11]
22
22
'''
23
23
#!/bin/python3
24
24
import queue
You can’t perform that action at this time.
0 commit comments