Easy to understand C++ 10 liner (no reverse used)
Idea\nAll you have to do is do the standard bfs(with two stacks instead) with two adjustments -\n\n1) instead of dequeueing from a queue, pop() from our first s
**Idea**\nAll you have to do is do the standard bfs(with two stacks instead) with two adjustments -\n\n1) instead of dequeueing from a queue, pop() from our first stack pointer. Simmilarly instead of enqueueing push to our second stack pointer.\n2) In queue you will push in left child then right child in every level. Here we alternately first push right and left (why? because you want to have level two in reverse order), then in second iteration left and right and so on.\n\nAt the end of each level just swap the stack pointers before moving to next level.\n\nI tried to keep it simple for you, hope I was able to do that. If I missed anything trying to do so, let me know in the comments would be happy to help.\n\n**Code**\n```cpp\n\t#define tn TreeNode\n    vector<vector<int>> zigzagLevelOrder(TreeNode* root) {\n        vector<vector<int>> ans; if(!root) return ans;\n        stack<tn*> a, b;\n        stack<tn*> *stk1 = &a, *stk2 = &b; a.push(root);\n        while(!stk1->empty()){\n            ans.push_back(vector<int> (0));\n            while(!stk1->empty()){\n                tn *cur = stk1->top();\n                stk1->pop();\n                ans.back().push_back(cur->val);\n                if(stk1 != &b && cur->left) stk2->push(cur->left);\n                if(cur->right)stk2->push(cur->right);\n                if(stk1 == &b && cur->left) stk2->push(cur->left);\n            }\n            swap(stk1, stk2);\n        }\n        return ans;\n    }\n```
['Stack', 'Breadth-First Search', 'C', 'C++']