Tree: Inorder Traversal

  • + 0 comments
    def inOrder(root):
        result = []
        
        def traverse(node):
            if not node:
                return
            traverse(node.left)
            result.append(str(node.info))
            traverse(node.right)
    
        traverse(root)
        print(" ".join(result))