将一个字符串按照ZIGZAG方式打印,举例说明 ///nRows:2///1, 3, 5 step: 2///2, 4, 6 step: 2//////nRows:3///1, 5, 9 step: 4///2, 4, 6, 8, 10 step:2 2///3, 7, 11 step: 4////...
分类:
其他好文 时间:
2015-03-05 10:33:16
阅读次数:
120
[LeetCode] 006. ZigZag Conversion (Easy) (C++/Java/Python)...
分类:
编程语言 时间:
2015-02-28 00:17:32
阅读次数:
188
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-02-21 15:26:40
阅读次数:
185
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-02-17 19:52:54
阅读次数:
169
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:
Giv...
分类:
其他好文 时间:
2015-02-13 19:59:21
阅读次数:
198
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-02-10 15:12:10
阅读次数:
138
ZigZag Conversion
(图片来自http://www.cnblogs.com/sanghai/p/3632528.html)
向下循环:nRows
斜角线循环:nRows-2(减去首尾两个端点)
定义一列和一斜对角线的循环长度为dLen=nRows+nRows-2;
1 第一行和最后一行,均是由第一列加上dLen的倍数,即可
2 其余行,每计算出下一列的下标j之后...
分类:
其他好文 时间:
2015-02-08 11:41:09
阅读次数:
159
题目描述:ZigZag ConversionThe string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this patt...
分类:
其他好文 时间:
2015-02-07 13:05:22
阅读次数:
127
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-02-03 21:04:41
阅读次数:
133
原题地址找规律题代码: 1 string convert(string s, int nRows) { 2 string res; 3 4 if (nRows <= 1) 5 return s; 6 7 ...
分类:
其他好文 时间:
2015-02-02 17:58:17
阅读次数:
163