题目描述如下: 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 fix ...
分类:
其他好文 时间:
2016-09-05 10:24:09
阅读次数:
168
题目来自2014年12月CCF计算机职业资格认证考试 问题描述 在图像编码的算法中,需要将一个给定的方形矩阵进行Z字形扫描(Zigzag Scan)。给定一个n×n的矩阵,Z字形扫描的过程如下图所示: 对于下面的4×4的矩阵, 1 5 3 9 3 7 5 6 9 4 6 4 7 3 1 3 对其进行 ...
分类:
其他好文 时间:
2016-09-04 22:18:05
阅读次数:
186
原题如下: 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 ...
分类:
其他好文 时间:
2016-09-02 23:25:14
阅读次数:
139
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 ...
分类:
其他好文 时间:
2016-09-02 23:12:12
阅读次数:
196
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 ...
Question:
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:...
分类:
其他好文 时间:
2016-08-19 20:53:53
阅读次数:
169
题目描述: 该开始就输在了理解题意上。。 没搞懂zigzag是什么意思。 查了一些解释终于明白要干什么了。 将一个字符串按照Z字形排列(侧着看);再把结果按行输出。 刚开始的想法是讲字符串按照规则排列在一个二维数组中,然后按序扫描数组输出。时间复杂度为O(n2). 进一步改进,按行数生成n个字符串, ...
分类:
其他好文 时间:
2016-08-19 11:20:27
阅读次数:
100
https://leetcode.com/problems/zigzag-conversion/ 题目: 将字符串转化成zigzag模式。 例如 "abcdefghijkmlnpq" 当为4行,zigzag模式为: 思路:以题目中当行为4的为例,将字符串"abcdefghijkmlnpq" 首先转换 ...
分类:
其他好文 时间:
2016-08-13 21:12:53
阅读次数:
135