Given a binary tree, return the postorder traversal of its nodes' values.
Example:
Input: [1,null,2,3]
   1
    \
     2
    /
   3
Output: [3,2,1]
Follow up: Recursive solution is trivial, could you do it iteratively?
# Definition for a binary tree node.
 # class TreeNode:
 #     def __init__(self, x):
 #         self.val = x
 #         self.left = None
 #         self.right = None
 
 class Solution:
     def postorderTraversal(self, root):
         """
         :type root: TreeNode
         :rtype: List[int]
         """
         path = []
         
         def postOrder(root):
             if not root:
                 return
             postOrder(root.left)
             postOrder(root.right)
             path.append(root.val)
             
         postOrder(root)
         return path
# Definition for a binary tree node.
 # class TreeNode:
 #     def __init__(self, x):
 #         self.val = x
 #         self.left = None
 #         self.right = None
 
 class Solution:
     def postorderTraversal(self, root):
         """
         :type root: TreeNode
         :rtype: List[int]
         """
         path = []
         
         def postOrder(root):
             if not root:
                 return
             postOrder(root.left)
             postOrder(root.right)
             path.append(root.val)
             
         postOrder(root)
         return path