C++ level order traversal using queue
\n\n\n\nint maxLevelSum(TreeNode* root) {\n        int current_max = INT_MIN;\n        int current_max_level = 0;\n        queue<TreeNode*> q;\n        q.push(r
\n\n\n```\nint maxLevelSum(TreeNode* root) {\n        int current_max = INT_MIN;\n        int current_max_level = 0;\n        queue<TreeNode*> q;\n        q.push(root);\n        int level = 0;\n        while(!q.empty()) {\n            int current_sum = 0;\n            ++level;\n            for (int i = q.size(); i > 0; --i) {\n                TreeNode* n = q.front();\n                q.pop();\n                current_sum += n->val;\n                if (n->left != NULL) \n                    q.push(n->left);\n                if (n->right != NULL)\n                    q.push(n->right);\n            }\n            if (current_sum > current_max) {\n                current_max = current_sum;\n                current_max_level = level;\n            }\n        }\n        return current_max_level;\n    }\n\t```
['C']