Spiral MatrixGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following m...
分类:
其他好文 时间:
2014-10-23 19:03:17
阅读次数:
272
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
class Solution {
public:
void rotate(std::vector >...
分类:
其他好文 时间:
2014-10-23 12:37:18
阅读次数:
187
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ]
]
You...
分类:
其他好文 时间:
2014-10-23 12:36:01
阅读次数:
176
Given an integer n, generate a square matrix filled with elements from 1 to n2 in
spiral order.
For example,
Given n = 3,
You should return the following matrix:
[
[ 1, 2, 3 ],
[ 8, 9, 4 ],
[...
分类:
其他好文 时间:
2014-10-23 12:31:39
阅读次数:
132
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ]
]
...
分类:
其他好文 时间:
2014-10-23 00:11:12
阅读次数:
157
将图片旋转90°,实际上就是在操作数组,感觉实际中canvas可以用到。public class Solution { public void rotate(int[][] matrix) { if (matrix.length == 1) { return...
分类:
其他好文 时间:
2014-10-22 23:30:46
阅读次数:
229
1. Matrix.java package net.wuhx.main;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class Matrix {
private String rowText = "";
priva...
分类:
编程语言 时间:
2014-10-22 18:36:53
阅读次数:
174
FZU 1911 Construct a Matrix ( 矩阵快速幂 + 构造 )题意:需要构造一个矩阵满足如下要求:1.矩阵是一个S(N)*S(N)的方阵2.S(N)代表斐波那契数列的前N项和模上M3.矩阵只能由1, 0, -1组成4.矩阵每行每列的和不能相等Here, the Fibonacc...
分类:
其他好文 时间:
2014-10-22 06:16:38
阅读次数:
313
HDU 5015 233 Matrix ( 矩阵快速幂 )这是西安网络赛的一题,,但是YY之还是没有搞出来。。后来学习了,今天写个题解吧题意:给定一个矩阵的第一列,然后需要推算出第n行第m列的数值分析:矩阵快速幂搞之构造矩阵如下(需要再增加233 和 3 两行进行状态转移)1 0 0 0 0 0 0...
分类:
其他好文 时间:
2014-10-22 06:14:34
阅读次数:
240
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.题意:在一个只有0、1的矩阵中找到一个面积最大的矩形,它内部所有的...
分类:
其他好文 时间:
2014-10-21 11:46:41
阅读次数:
129