parameters: (self, t)
return_statement: return s
docstring: :type t: TreeNode
          :rtype: str
docstring_summary: :type t: TreeNode
          :rtype: str
docstring_tokens: : type t : TreeNode : rtype : str
function: def tree2str(self, t):
          """
          :type t: TreeNode
          :rtype: str
          """
          if not t: return ""
          s = str(t.val)
          if t.left or t.right:
              s += "(" + self.tree2str(t.left) + ")"
          if t.right:
              s += "(" + self.tree2str(t.right) + ")"
          return s
function_tokens: def tree2str ( self , t ) : if not t : return "" s = str ( t . val ) if t . left or t . right : s += "(" + self . tree2str ( t . left ) + ")" if t . right : s += "(" + self . tree2str ( t . right ) + ")" return s