一张图像表示成NxN的矩阵,图像中每个像素是4个字节,写一个函数把图像旋转90度。 你能原地进行操作吗?(即不开辟额外的存储空间)
这个题第一感觉就是一次交换矩阵的元素:
比如 3*3 矩阵
1 2 3
4 5 6
7 8 9
先处理第一行,一次逆时针旋转四个元素,下面是二次做的
3 2 9 3 6 9
4 5 6 2 5 8
1 8 7 ...
分类:
其他好文 时间:
2014-08-15 21:10:17
阅读次数:
301
在flash中,只有关键帧由用户提供,其余帧通过补间完成,而这次设计的动画精灵的所有帧全部由用户提供(来源于图片素材),这样大大简化了设计。...
分类:
其他好文 时间:
2014-08-15 21:09:59
阅读次数:
249
poj 1113 Wall(标准的凸包果题)...
分类:
其他好文 时间:
2014-08-15 21:09:39
阅读次数:
342
Given a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descending order....
分类:
其他好文 时间:
2014-08-15 21:08:29
阅读次数:
212
1、js、jsp种判断list长度 js : list.length jsp: list的长度是:${fn:length(list)}
分类:
其他好文 时间:
2014-08-15 21:08:22
阅读次数:
196
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2689 Sort itProblemDescriptionYouwanttoprocesseasequenceofndistinctintegersbyswap...
分类:
其他好文 时间:
2014-08-15 21:08:09
阅读次数:
209
(一)树状数组的概念如果给定一个数组,要你求里面所有数的和,一般都会想到累加。但是当那个数组很大的时候,累加就显得太耗时了,时间复杂度为O(n),并且采用累加的方法还有一个局限,那就是,当修改掉数组中的元素后,仍然要你求数组中某段元素的和,就显得麻烦了。所以我们就要用到树状数组,他的时间复杂度为O(...
分类:
其他好文 时间:
2014-08-15 21:07:39
阅读次数:
260
1 package POJ; 2 3 public class Main { 4 5 /** 6 * 7 * MergeSort 8 * 9 */10 public static void main(String[] args) {1...
分类:
其他好文 时间:
2014-08-15 21:07:29
阅读次数:
162
首先保证JDK、Hadoop安装设置成功可以参考[linux]ubuntu下安装hadoop[linux]ubutnu12.04 下安装jdk1.7使用hadoop版本为1.2.1,jdk为1.7在hadoop-1.2.1\src\examples\org\apache\hadoop\example...
分类:
其他好文 时间:
2014-08-15 21:06:49
阅读次数:
636
Float double 类型在计算机的存储方式 计算机中只认识10的二进制数,那么该如何存储小数呢? 那么我们先看Floa类型:Float在计算机(32位)中是4个字节的,具体地:第一位为符号位0为正,1为负 第2到第9位为指数位,第10到32位为尾数位,具体地如下图所示:1291032现在我们举...
分类:
其他好文 时间:
2014-08-15 21:06:09
阅读次数:
213
那些留下来的歌1, 那些花儿 ,范玮琪2, 哀愁 ,辛晓琪3, 猜不透 ,丁当4, 寂寞的季节 ,陶喆5, promise ,山岡晃6, everybody hurts ,Avril Lavigne7, The sound of silence ,Simon & Garfunkel8, 17 ,Av...
分类:
其他好文 时间:
2014-08-15 21:05:59
阅读次数:
247
本文简要描述线性回归算法在Spark MLLib中的具体实现,涉及线性回归算法本身及线性回归并行处理的理论基础,然后对代码实现部分进行走读。
分类:
其他好文 时间:
2014-08-15 21:05:49
阅读次数:
562
1>msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) 已经在 libcmt...
分类:
其他好文 时间:
2014-08-15 21:05:39
阅读次数:
348
You should first runupdate, thenupgrade. Neither of them automatically runs the other.apt-get updateupdates the list of available packages and their v...
分类:
其他好文 时间:
2014-08-15 21:05:19
阅读次数:
229
1. ListView须要设置adapter,它的item是通过adapter的方法getView(int position, View convertView, ViewGroup parent)获得的。2. ListView中仅仅有第一屏的item须要新建,它的引用会被存在RecycleBin对...
分类:
其他好文 时间:
2014-08-15 21:05:09
阅读次数:
200
手动设定实例变量的KVO实现监听如果将一个对象设定成属性,这个属性是自动支持KVO的,如果这个对象是一个实例变量,那么,这个KVO是需要我们自己来实现的.以下给出源码供君测试:Student.h 与 Student.m//// Student.h// SuperNotification//// .....
分类:
其他好文 时间:
2014-08-15 21:04:59
阅读次数:
248