GoLang Solution For LeetCode Problem: Binary Tree Zigzag Level Order Traversal
Solving Binary Tree Zigzag Level Order Traversal in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Problem Description
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],
3
/ \
9 20
/ \
15 7
return its zigzag level order traversal as:
[
[3],
[20,9],
[15,7]
]
See the full details of the problem Binary Tree Zigzag Level Order Traversal at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go
Comments
Leave a comment
You are not LoggedIn but you can comment as an anonymous user which requires manual approval. For better experience please Login.