C++ | BFS | Reverse | Easy | ~93% Space ~41% Time
\nclass Solution {\npublic:\n    vector<vector<int>> zigzagLevelOrder(TreeNode* root) {\n      vector<vector<int>> ans;\n      if(!root) return {};\n      queue
```\nclass Solution {\npublic:\n    vector<vector<int>> zigzagLevelOrder(TreeNode* root) {\n      vector<vector<int>> ans;\n      if(!root) return {};\n      queue<TreeNode *> q;\n      q.emplace(root);\n      while(!q.empty()){\n        int sz = q.size();\n        vector<int> temp;\n        for(int i = 0; i < sz; i++){\n          auto qf = q.front(); q.pop();\n          temp.emplace_back(qf->val);\n          if(qf->left) q.emplace(qf->left);\n          if(qf->right) q.emplace(qf->right);\n        }\n        ans.emplace_back(temp);\n      }\n      for(int i = 0; i < ans.size(); i++){\n        if(i % 2) reverse(ans[i].begin(), ans[i].end());\n      }\n      return ans;\n    }\n};\n```
['Breadth-First Search', 'Queue', 'C', 'C++']