如果矩阵中存在0,那么把0所在的行和列都置为0。要求在所给的矩阵上完成操作。...
分类:
其他好文 时间:
2016-01-21 13:58:10
阅读次数:
144
Use additional O(m+n) space, simple improvement. Two array, one is of size row, to store the status of each row, whether there is a 0 element in the r...
分类:
其他好文 时间:
2016-01-21 06:56:43
阅读次数:
128
https://leetcode.com/problems/longest-increasing-path-in-a-matrix/Given an integer matrix, find the length of the longest increasing path.From each ce...
分类:
其他好文 时间:
2016-01-21 00:07:17
阅读次数:
251
1)做矩阵F是.txt格式,右矩阵B是SequenceFile,代码如下: 1 package matrix; 2 3 import java.io.BufferedReader; 4 import java.io.FileReader; 5 import java.io.IOExcep...
分类:
其他好文 时间:
2016-01-20 22:10:05
阅读次数:
196
代码:public class Solution { public List spiralOrder(int[][] matrix) { List resultList = new ArrayList(); int row = matrix.length; ...
分类:
其他好文 时间:
2016-01-19 12:05:44
阅读次数:
129
矩阵 题目大意:矩阵里面的元素按i*i+100000*i+j*j-100000*j+i*j填充(i是行,j是列),求最小的M个数 这一题要用到两次二分,实在是二分法的经典,主要是每一列都是按照行来递增的,每一行我们都用二分法找到比mid小的那...
分类:
其他好文 时间:
2016-01-19 01:30:40
阅读次数:
133
代码:public class Solution { public void rotate(int[][] matrix) { int n = matrix.length; for(int i = 0; i < n/2; i++){ int n...
分类:
其他好文 时间:
2016-01-18 13:50:51
阅读次数:
154
一.概述Android 图片要实现:手势滑动,双击变大,多点触控的效果. 其实是有一定难度的,我们需要用Matrix ,GestureDetector 等等需要完成一个复杂的逻辑才能实现,然而今天我要说的并不是这种方法,而是一个第三方库Photoview,它使得完成图片缩放工作只需要3-5行代码就搞...
分类:
移动开发 时间:
2016-01-18 10:30:17
阅读次数:
228
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:
其他好文 时间:
2016-01-16 14:15:49
阅读次数:
215
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted in asc...
分类:
其他好文 时间:
2016-01-16 14:15:42
阅读次数:
167