Given the root node of a tree, return a list where each element is the width of the tree at each level.
A
/ | \
B C D
| |
E F
Answer: [1, 3, 2]
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
Given the root node of a tree, return a list where each element is the width of the tree at each level.
A
/ | \
B C D
| |
E F
Answer: [1, 3, 2]