leetcode 103:二叉树的锯齿形层次遍历

二叉树的问题,这个题我选择使用队列来做,两个队列,可能方法比较笨 std::vector<std::vector<int>> zigzagLevelOrder(TreeNode* root) { std::vector<std::vector<int>>a; std::deque<TreeNode*>q1; std::deque<TreeNode*>q2; std:
相关文章
相关标签/搜索