QUEUE || SHORT & SWEET C++ CODE
\nclass Solution {\npublic:\n    vector<vector<int>> levelOrder(TreeNode* root) {\n        if(root == NULL)return {};\n        vector<vector<int>> ans;\n       
```\nclass Solution {\npublic:\n    vector<vector<int>> levelOrder(TreeNode* root) {\n        if(root == NULL)return {};\n        vector<vector<int>> ans;\n        vector<int> v;\n        int n;\n        queue<TreeNode*> q;\n        TreeNode* p;\n        q.push(root);\n        while(!q.empty()){\n            n = q.size();\n            v.clear();\n            while(n--){\n                p = q.front();\n                q.pop();\n                v.push_back(p->val);\n                if(p->left){\n                    q.push(p->left);\n                }if(p->right){\n                    q.push(p->right);\n                }\n            }\n            ans.push_back(v);\n        }\n        return ans;\n    }\n};\n```
['Tree', 'Breadth-First Search', 'Queue', 'C', 'Binary Tree', 'C++']