标签:style http image children bubuko val ack one def
题目如下:
解题思路:凑数题+1,话说我这个也是凑数博?
代码如下:
class Solution(object): def preorder(self, root): """ :type root: Node :rtype: List[int] """ if root == None: return [] res = [] stack = [root] while len(stack) > 0: node = stack.pop(0) res.append(node.val) for i in node.children[::-1]: stack.insert(0,i) return res
【leetcode】589. N-ary Tree Preorder Traversal
标签:style http image children bubuko val ack one def
原文地址:https://www.cnblogs.com/seyjs/p/9397650.html