text: # 144. 二叉树的前序遍历
  #
  # 20200810
  # huao
  
  from typing import List
  
  
  class TreeNode:
      def __init__(self, x):
          self.val = x
          self.left = None
          self.right = None
  
  
  class Solution:
      def preorderTraversal(self, root: TreeNode) -> List[int]:
          if root == None:
              return []
          left = self.preorderTraversal(root.left)
          right = self.preorderTraversal(root.right)
          return [root.val] + left + right
  