Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al...
分类:
其他好文 时间:
2015-10-26 11:46:58
阅读次数:
172
题目:矩阵的之字型遍历给你一个包含mxn个元素的矩阵 (m行,n列), 求该矩阵的之字型遍历。样例对于如下矩阵:[ [1, 2, 3, 4], [5, 6, 7, 8], [9,10, 11, 12]]返回[1, 2, 5, 9, 6, 3, 4, 7, 10, 11, 8, 12]解...
分类:
其他好文 时间:
2015-10-18 11:26:19
阅读次数:
160
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...
分类:
其他好文 时间:
2015-10-12 08:08:22
阅读次数:
217
Binary Tree Zigzag Level Order TraversalGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then...
分类:
其他好文 时间:
2015-10-08 00:20:08
阅读次数:
202
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...
分类:
其他好文 时间:
2015-10-02 23:43:21
阅读次数:
297
[Problem]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 fixe...
分类:
其他好文 时间:
2015-10-02 00:16:39
阅读次数:
203
QuestionGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next leve...
分类:
其他好文 时间:
2015-09-24 08:16:34
阅读次数:
218
翻译字符串“PAYPALISHIRING”通过一个给定的行数写成如下这种Z型模式:
P A H N
A P L S I I G
Y I R然后一行一行的读取:“PAHNAPLSIIGYIR”写代码读入一个字符串并通过给定的行数做这个转换:string convert(string text, int nRows);调用convert("PAYPALISHIRING", 3),应该...
分类:
其他好文 时间:
2015-09-22 06:42:32
阅读次数:
237
Capable to k-vector input too:class ZigzagIterator { int x; int i; int max_x; vector*> l; void moveon() { int oldi= i...
分类:
其他好文 时间:
2015-09-15 06:56:31
阅读次数:
152
需求:将所给的字符串以“倒N型”输出,可以指定输出的行数函数 String convert(String s, int numRows)例如输入“abcdefghijklnmopqrstuvwxyz”,输出成3行;得到a e i n q u y bdfhjlmprtvxz c g k o s w 下...
分类:
其他好文 时间:
2015-09-14 22:46:34
阅读次数:
255