input: Write a function to perform pre-order traversal on a binary tree.
  assert preOrder(TreeNode(1, TreeNode(2), TreeNode(3))) == [1, 2, 3]
  assert preOrder(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNode(3))) == [1, 2, 4, 5, 3]
  assert preOrder(TreeNode(1)) == [1]
output: def preOrder(root):
      if root is None:
          return []
      return [root.val] + preOrder(root.left) + preOrder(root.right)
  
  class TreeNode:
      def __init__(self, val=0, left=None, right=None):
          self.val = val
          self.left = left
          self.right = right