def preorder(self, n): if n != None: print(str(n.item),'',end='') if n.left: self.preorder(n.left) if n.right: self.preorder(n.right)