input: Write a function to determine the sum of all elements in a binary tree. If the root of the tree is None, return 0. Otherwise, recursively calculate the sum of the root's value and the sums of its left and right subtrees.
  assert sum_tree(None)==0
  assert sum_tree(TreeNode(1, TreeNode(2), TreeNode(3)))==6
  assert sum_tree(TreeNode(5, None, TreeNode(3, TreeNode(2), None)))==10
  assert sum_tree(TreeNode(0, TreeNode(1, TreeNode(2), TreeNode(3)), TreeNode(4)))==10
  assert sum_tree(TreeNode(-1, TreeNode(-2, TreeNode(-3)), TreeNode(-4)))==-10
output: def sum_tree(root):
      if root is None:
          return 0
      return root.val + sum_tree(root.left) + sum_tree(root.right)