Runtime: 0 ms, faster than 100.00% [c++]
\n     class Solution {\n         public:\n            vector> levelOrder(TreeNode root) {\n                if(root==NULL)\n                   return {};\n     
\n     class Solution {\n         public:\n            vector<vector<int>> levelOrder(TreeNode* root) {\n                if(root==NULL)\n                   return {};\n               vector<vector<int>> ans; \n                queue<TreeNode*> q;\n                q.push(root);\n                TreeNode *temp;\n                int len;\n                while(!q.empty()){\n                   len=q.size();\n\t\t\t       vector<int> v;\n                   for(int i=0;i<len;i++){\n                        temp=q.front();\n                        q.pop();\n                        v.push_back(temp->val);\n\n                       if(temp->left) q.push(temp->left);\n                       if(temp->right) q.push(temp->right);\n                    }\n\t\t\t        ans.push_back(v);\n                }\n              return ans;\n            }\n         };\n\t\n\t\n**Feel free to ask any question in the comment section.\nIf you like this solution, do UPVOTE.\nHappy Coding :)**\n\t
['Breadth-First Search', 'Queue', 'C', 'C++']