1"""Inorder Traversing"""
2def inorder_traversing(self, root):
3 res = []
4 if root:
5 res = self.inorder_traversing(root.left)
6 res.append(root.data)
7 res = res + inorder_traversing(root.right)
8 return res
1"""Post-order"""
2 def postorder_traversal(self, root):
3 res = []
4
5 if root:
6 res = self.predorder_traversal(root.left)
7 res = res + self.predorder_traversal(root.right)
8 res.append(root.data)
9 return res