Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Average of Levels in Binary Tree
Bookmark
Input
Example 1
Complete Tree
Large Values
Four Levels
Custom
tree
=
[3, 9, 20, null, null, 15, 7]
3
9
20
15
7
L0
L1
L2
queue
result
level-order traversal (BFS)
algo
master
.
io
Step:
Start: compute the average of each level with BFS
0 / 17
Input
Example 1
Complete Tree
Large Values
Four Levels
Custom
tree
=
[3, 9, 20, null, null, 15, 7]
0 / 17
3
9
20
15
7
L0
L1
L2
queue
result
level-order traversal (BFS)
algo
master
.
io
Step:
Start: compute the average of each level with BFS