C++ SIMPLE SOLUTION || BFS || BEST SOLUTION
\nclass Solution {\npublic:\n\n    vector> levelOrder(TreeNode root) {\n        vector> v ; \n        queueq;\n        q.push(root);\n        if(root == NULL)\n
\nclass Solution {\npublic:\n\n    vector<vector<int>> levelOrder(TreeNode* root) {\n        vector<vector<int>> v ; \n        queue<TreeNode*>q;\n        q.push(root);\n        if(root == NULL)\n            return v ;\n        \n        while(!q.empty()){\n            int x = q.size();\n            vector<int>v1;\n            while(x--){\n                TreeNode* front = q.front();\n                q.pop();\n                if(front->left != NULL){\n                    q.push(front->left);\n                }\n                if(front->right != NULL){\n                    q.push(front->right);\n                }\n                \n               v1.push_back(front->val); \n            }\n            v.push_back(v1);\n            \n        }\n        return v;\n    }\n};
['Tree', 'Breadth-First Search', 'Queue', 'C', 'Binary Tree', 'C++']