input: Write a function to calculate the sum of all elements in a given binary tree. If the tree is empty, the sum should be 0.
  def sum_tree(root):
      if root is None:
          return 0
  
      return root.val + sum_tree(root.left) + sum_tree(root.right)
  
  assert sum_tree(None)==0
  assert sum_tree(BinaryTreeNode(5, BinaryTreeNode(3), BinaryTreeNode(1, None, BinaryTreeNode(4))))==13
  assert sum_tree(BinaryTreeNode(2, BinaryTreeNode(0, BinaryTreeNode(1))))==3
  assert sum_tree(BinaryTreeNode(1, None, BinaryTreeNode(3, BinaryTreeNode(0, None, BinaryTreeNode(4)))))==8
output: def sum_tree(root):
      if root is None:
          return 0
  
      return root.val + sum_tree(root.left) + sum_tree(root.right)