My Blog List

[Leetcode Solution] Binary Tree Zigzag Level Order Traversal

Analysis

  • Using BFS search each layer of binary tree from the root to leaf
  • When push back nodes in each layer to the result vector, push back them alternatively in order and reversed order

Note

Code


No comments:

Post a Comment

Enter you comment