Open weikee94 opened 4 years ago
Tree
示例代码
def preorder(self, root) if root: self.traverse.append(root.val) self.preorder(root.left) self.preorder(root.right) def inorder(self, root) if root: self.inorder(root.left) self.traverse.append(root.val) self.inorder(root.right) def postorder(self, root) if root: self.postorder(root.left) self.postorder(root.right) self.traverse.append(root.val)
Map
The difference from a regular Object:
Object
size
Set
Tree
示例代码