题目
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?
方法
矩阵坐标的转换,循环替换。
public voi...
分类:
其他好文 时间:
2014-06-16 11:28:03
阅读次数:
199
三角碎片以非常缓慢的速度旋转移动,如果使用JS实现会出现一像素一像素移动的卡顿
使用CSS3会获得非常理想的效果
transform: translate3d(80px, 150px, 0px) rotate(1220deg);
transition: transform 30s linear 0s;
上面一个属性表示图像变换
translate3d(80px, 150px, 0px) 表...
分类:
移动开发 时间:
2014-06-15 17:15:34
阅读次数:
188
一、动画类型Android的animation由四种类型组成:alpha、scale、translate、rotateXML配置文件中alpha渐变透明度动画效果scale渐变尺寸伸缩动画效果translate画面转换位置移动动画效果rotate画面转移旋转动画效果Java
Code代码中Alpha...
分类:
移动开发 时间:
2014-06-13 19:54:50
阅读次数:
397
Rotate ListGiven a list, rotate the list to the
right bykplaces, wherekis non-negative.For
example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3-...
分类:
其他好文 时间:
2014-06-13 16:39:53
阅读次数:
307
又是一条数论题目,最近学习数论,看完书本感觉并不能掌握数论的,还是需要多多练习,多运用才能掌握这个思想武器的。
本题可以简单点过,不需要太高级的数论内容;
但是也可以运用好数论的内容,可以应用上三个数论的内容:
1 扩展欧几里得
2 快速求模
3 乘法逆元(inverse of modulo)
2 快速求模,也可以生成一个数组,因为这里最大是40000,故此数值不大,可以使用数组,然后查表,速度很快。
但是这里使用快速的时间效率也几乎接近常数,没必要保存一个数组。如下面的powMod函数。
3 乘法...
分类:
其他好文 时间:
2014-06-11 00:55:53
阅读次数:
351
题目:...
解题思路:
顺时针方向旋转数组90°。这个题也是个没啥意思的题,自己画画图,找找规律。就出来了。我举一个n=4的例子还说明下规律:
通过图可以看出A[0][0] = A[3][0],....。从这些中我们可以找到如下规律:
A[i][j] = A[n-1-j][i];
A[n-1-j][i] = A[n-1-i][n-1-j];
A[n-1-i][n-1-j] = A[j][n-1-i];
A[j][n-1-i] = A[i][j];(原来的A[i][j...
分类:
其他好文 时间:
2014-06-10 18:09:47
阅读次数:
281
解决办法 :
把 deploy.bat 文件中的 下面一句话中的蓝色部分 换为红色部分
http://localhost:8081/GetMsgService/servlet/AxisServlet deploy.wsdd
set Axis_Lib=D:\axis-1_4\lib
set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%
set Axis_Servlet=http://localhost:8080/axistest/services/AxisServle...
分类:
Web程序 时间:
2014-06-10 15:42:16
阅读次数:
265
1、错误描述
六月 09, 2014 11:11:09 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Expression a is undefined on line 27, column 23 in tag.ftl."
Expression a is undefi...
分类:
其他好文 时间:
2014-06-10 07:33:34
阅读次数:
293
Graph coloring is the problem of assigning a color to each vertex of an undirected graph such that no two adjacent vertices have the same color. We implement the greedy algorithm from Scalable parallel graph coloring algorithms. The algorithm iteratively f...
分类:
其他好文 时间:
2014-06-10 07:10:19
阅读次数:
260
题目链接题意: 给出 n * n的矩阵,要求将矩阵顺时针旋转90°(不使用额外空间) 1 /* 2
Basically, divide the array into 4 along the diagonals, 3 then for each element
in the top ...
分类:
其他好文 时间:
2014-06-09 15:28:14
阅读次数:
280