Skip to content

Commit 199a581

Browse files
committed
Runtime 52 ms (Top 66.12%) | Memory 16.0 MB (Top 80.3%)
1 parent 961b467 commit 199a581

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution(object):
2+
def postorder(self, root):
3+
"""
4+
:type root: Node
5+
:rtype: List[int]
6+
"""
7+
res=[]
8+
def bfs(root):
9+
if root:
10+
for child in root.children:
11+
bfs(child)
12+
13+
res.append(root.val)
14+
bfs(root)
15+
16+
return res

0 commit comments

Comments
 (0)