97: Zigzag level order traversal of a binary tree

Given a binary tree, return zigzag level order traversal, i.e. from left to right, then right to left etcetera

 

Example 1

Input:     1   
          / \  
         5   3 
        / \
       4   7

Output: [[1], [3, 5], [4, 7]]

Example 2

Input:     1   
          / \  
         5   3 
            / \
           4   7

Output: [[1], [3, 5], [4, 7]]
Difficulty:Medium
Topic:Tree
Problem #:97