category-wise-problems

contains category wise problems(data structures, competitive) of popular platforms.

View the Project on GitHub mayankdutta/category-wise-problems

102. Binary Tree Level Order Traversal

code ```cpp class Solution { public: vector<vector> levelOrder(TreeNode* root) { vector<vector> ans; if (root == nullptr) return {}; queue<TreeNode*> qu; qu.push(root); while (!qu.empty()) { vector temp; int Size = qu.size(); for (int i = 0; i < Size; i++) { auto root = qu.front(); qu.pop(); temp.push_back(root -> val); if (root -> left) qu.push(root -> left); if (root -> right) qu.push(root -> right); } ans.push_back(temp); } return ans; } }; ``` </details>