- 博客(133)
- 资源 (3)
- 收藏
- 关注
原创 剑指offer题三:二维数组中的
题目描述:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。输入:输入可能包含多个测试样例,对于每个测试案例,输入的第一行为两个整数m和n(1输入的第二行包括一个整数t(1接下来的m行,每行有n个数,代表题目所给出的m行n列的矩阵(矩阵如题目描述所示,每一
2014-11-09 11:30:09
1030
原创 矩阵旋转90度
Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees Can you do this in place?
2014-09-03 20:17:39
1388
原创 determine if a string has all unique characters
public class UniqueChar{ public static void main(String[] args) { String s1="abcd124"; String s2= "abacd234gaf"; String s3="abcd"; String s4="abcdeb"; System.out.println("unique1: true?
2014-08-31 16:02:05
751
转载 内存脏数据下刷(linux2.6.18/linux.2.6.32)剖析
1 前言BDI机制原本主要是用于检测磁盘的繁忙程度等作用,从2.6.19内核开始,将此部分功能整合到了mm/backing_dev.c中,一直到2.6.31内核为止,其功能也只是在不段的完善,但是脏数据的下刷依然是依靠pdflush。自2.6.32内核开始,彻底取消了pdflush,而是将此部分功能添加到BDI机制中,并且是为每个设备创建了一个名为“flush-设备主次设备号”的线程,
2014-08-28 18:55:51
2175
原创 dd命令的conv=fsync,oflag=sync/dsync
使用dd来测试硬盘读写速度dd只能提供一个大概的测试结果,而且是连续IO 而不是随机IO ,理论上文件规模越大,测试结果越准确。
2014-07-23 19:33:40
38032
3
原创 linux中特殊的设备(/dev/zeo,/dev/null,/dev/unrandom,/dev/random)
Linux中的随机数文件 /dev/random /dev/urandom
2014-07-23 19:09:09
3537
原创 block(块),page(页),buffer cache(块缓冲)区别与联系
在自己的理解里,块就是用来管理磁盘空间的,就像我们在给一个磁盘建立
2014-07-14 10:00:02
16874
原创 java 21 : StringBuilder/StringBuffer/String
前边我们已经有一篇详细讲解了下String,我们知道String 是一个final类,他不能被继承,不能b
2014-07-12 16:34:19
1186
原创 java 20:回文串检查,将16进制化为10进制
1 检查回文字符串import java.util.Scanner;public class CheckPalin{ public static void main(String [] args) { Scanner input=new Scanner(System.in); String s=input.nextLine(); int j=s.length()-
2014-07-03 21:03:13
1048
原创 java 19:不可变字符串和限定字符串(Immutable String and Interned String)
1 String 的构造Astringis a sequence of characters. In many languages, strings are treated as an array of characters, but in Java a string is an object. The Stringclass has 11 constructors and more than
2014-07-02 20:45:40
2732
原创 java 13:数组排序——选择排序及插入排序
1 选择排序Suppose that you want to sort a list in ascending order. Selection sort finds the smallest num-ber in the list and places it first. It then finds the smallest number remaining and places it
2014-06-28 13:43:04
745
原创 java 12:数组的搜索——线性查找及二分法查找
Searching is the process of looking for a specific element in an array—for example, discover-ing whether a certain score is included in a list of scores. Searching is a common task in com-puter pr
2014-06-28 12:19:36
4786
原创 java 11:数组作为函数参数,数组做为函数返回值
我们可以将数组作为参数,传入到函数中,其实就像我们main函数中 public void mian
2014-06-28 00:06:11
27959
原创 java9:一维数组的声明,创建,初始化(single-dimensional arrays)
在说数组之前,还是得先说下声明与定义: 变量的定义(definition):用于为变量分配存储空间,还可以为变量指定初始值。在一个程序中,变量有且仅有一个定义; 变量的声明(declaration):用于向程序表明变量的类型和名字。定义也是声明:当定义变量时我们声明了它的类型和名字。可以通过使用extern关键字声明变量名而不定义它。
2014-06-22 19:53:29
2922
原创 java6:方法重载(overload)
The max method that was used earlier works only with the int data type. But what if youneed to determine which of two floating-point numbers has the maximum value? The solution
2014-06-22 11:54:31
934
原创 java5:方法(method)
1 定义方法: Defining a MethodThe syntax for defining a method is as follows:modifier returnValueType methodName(list of parameters) {// Method body;}
2014-06-22 11:03:51
1428
原创 java1:从控制台读取输入
Java uses System.out to refer to the standard output device and System.in to the standard input device. By default the output device is the display monitor, and the input device is
2014-06-20 23:57:46
710
gre阅读结构分析法思维导图
2014-06-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人