[leetcode 103] Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). For example: Given binary tree [3,9,20,null,null,15,7], return its zigzag level order traversal as: 문제 풀이: 기존 level 순회에서 레벨에 따라 reverse가 추가된다. /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *l..
2020. 12. 3.