Python solution ,very easy to understand,bfs
class Solution(object):\n    def levelOrder(self, root):\n        """\n        :type root: TreeNode\n        :rtype: List[List[int]]\n        """\n        if no
    class Solution(object):\n    def levelOrder(self, root):\n        """\n        :type root: TreeNode\n        :rtype: List[List[int]]\n        """\n        if not root:return []\n        stack,queue,res,nCount=[root],[],[[root.val]],1\n        while stack:\n            temp=stack.pop(0)\n            if temp.left:\n                stack.append(temp.left)\n            if temp.right:\n                stack.append(temp.right)\n            nCount-=1\n            if nCount==0:\n                queue=[x.val for x in stack]\n                res+=[queue] if queue else []\n                nCount=len(stack)\n        return res
['Breadth-First Search', 'Python']