Implementint sqrt(int x).Compute and return the square root ofx.求平方根, 用的是二分法. 从 0 - x, 使用二分的思想啊~为了防止overflow, 把low和up用long。然后return int类型就行了~据说还有一种牛顿迭...
分类:
其他好文 时间:
2015-02-25 08:01:21
阅读次数:
143
之前已经比较熟悉快排的基本思想了,其实现的方式也有很多种。下面我们罗列一些常见的实现方式:
版本一:算法导论上的单向扫描,选取最后一个元素作为主元
#include
using namespace std;
int partition(int data[], int low, int high)
{
int pivot = data[high]; // let the ...
分类:
编程语言 时间:
2015-02-24 18:46:40
阅读次数:
185
原作:Simon阿文 杂交编辑者:RhinoC 个人更推崇使用第二款神器ImageTriangulator:http://www.conceptfarm.ca/2013/portfolio/image-triangulator/当然也可以使用在线版工具编辑:http://www.ui3g.com/e...
分类:
其他好文 时间:
2015-02-24 10:14:09
阅读次数:
151
//对标准的输入的读取数据进行压缩,然后将其写到标准的输出
package com;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.compress.CompressionCodec;
import ...
分类:
其他好文 时间:
2015-02-23 21:15:04
阅读次数:
269
动态规划:从新手到专家March 26, 2013作者:Hawstein出处:http://hawstein.com/posts/dp-novice-to-advanced.html声明:本文采用以下协议进行授权:自由转载-非商用-非衍生-保持署名|Creative Commons BY-NC-ND...
分类:
编程语言 时间:
2015-02-23 13:07:53
阅读次数:
248
用eclipse实现程序逻辑功能,发现点.不出来提示,强制用alt+/也没有。
查了一些论坛,最后发现adt-bundle 默认没有提示,
需要修改一处设置,
Eclipse -> Window -> Perferences -> Java -> Editor ->Advanced...
分类:
其他好文 时间:
2015-02-22 17:21:54
阅读次数:
200
######################################################################ExploitTitle:FalseSQLinjectionandadvancedblindSQLinjection##Date:21/12/2011##Aut...
分类:
数据库 时间:
2015-02-21 14:18:59
阅读次数:
163
翻译自:http://www.yiiframework.com/wiki/760/yii-2-0-write-use-a-custom-component-in-yii2-0-advanced-template/简单模版中添加自定义组件:http://www.yiiframework.com/wik...
分类:
其他好文 时间:
2015-02-21 00:17:19
阅读次数:
663
1. 对文件的另一个操作是压缩文件。压缩文件算是linux与windows少有的相似之处。一般常用的压缩文件的扩展名大多是.tar(tar程序打包的数据),.tar.gz(tar程序打包的数据,经过gzip压缩),.tgz,.gz(gzip压缩的文件),.Z(compress程序压缩的文件),.b....
分类:
系统相关 时间:
2015-02-19 21:51:26
阅读次数:
286