题目描述:
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:
Gi...
分类:
其他好文 时间:
2014-12-01 10:12:10
阅读次数:
207
Binary Tree Zigzag Level Order TraversalGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then...
分类:
其他好文 时间:
2014-11-30 18:29:54
阅读次数:
204
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 ...
分类:
其他好文 时间:
2014-11-29 06:40:34
阅读次数:
167
给定一个树,按照Z字形记录每一行。例如:Given binary tree{3,9,20,#,#,15,7}, 3 / \ 9 20 / \ 15 7return its zigzag level order traversal as:[ [3], [20,9], ...
分类:
其他好文 时间:
2014-11-28 14:18:16
阅读次数:
131
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2014-11-28 14:14:43
阅读次数:
154
本题也属于层次遍历的变形,不同之处在于其遍历的方法是交替进行的,形成一个ZigZag的曲线形式,如下:代码如下: 1 struct TreeNode { 2 int val; 3 TreeNode* left; 4 TreeNode* rig...
分类:
其他好文 时间:
2014-11-27 18:09:13
阅读次数:
132
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2014-11-26 22:24:09
阅读次数:
154
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 ...
分类:
其他好文 时间:
2014-11-24 22:31:45
阅读次数:
196
ZigZag ConversionThe string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern...
分类:
其他好文 时间:
2014-11-23 17:30:46
阅读次数:
289
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2014-11-17 15:29:56
阅读次数:
198