Accepted C++ recursive solution with no queues
Simple algorithm: \n\n 1. do depth first recursive tree search\n 2. populate all vectors for each tree level from left to right\n 3. reverse even levels to conf
Simple algorithm: \n\n 1. do depth first recursive tree search\n 2. populate all vectors for each tree level from left to right\n 3. reverse even levels to conform with zigzar requirement\n\n.\n\n    class Solution {\n    vector<vector<int> > result;\n    public:\n    vector<vector<int> > zigzagLevelOrder(TreeNode *root) {\n        \n        if(root!=NULL)\n        {\n            traverse(root, 0);\n        }\n        \n        for(int i=1;i<result.size();i+=2)\n        {\n            vector<int>* v = &result[i];\n            std:reverse(v->begin(), v->end());\n        }\n        return result;\n    }\n    \n    void traverse(TreeNode* node, int level)\n    {\n        if(node == NULL) return;\n        \n        vector<int>* row = getRow(level);\n        row->push_back(node->val);\n        \n        traverse(node->left, level+1);\n        traverse(node->right, level+1);\n    }\n    \n    vector<int>* getRow(int level)\n    {\n        if(result.size()<=level)\n        {\n            vector<int> newRow;\n            result.push_back(newRow);\n        }\n        return &result[level];\n    }\n    };
[]