public class Solution { public int longestConsecutive(int[] nums) { HashMap hs = new HashMap(); for (int i : nums) { hs.pu...
分类:
其他好文 时间:
2015-05-29 11:29:33
阅读次数:
109
头文件:
#pragma once
#include
#include
#include
using namespace std;
template
class SeqStack
{
public:
SeqStack(size_t sz = INIT_SZ);
~SeqStack();
public:
bool empty()const;
bool full()cons...
分类:
编程语言 时间:
2015-05-29 10:11:53
阅读次数:
143
IO中主要的类和接口File、InputStream、OutputStream、Reader、Writer、Serialzable接口File类File类应用的小例子import java.io.File;
import java.io.IOException;public class FileDemo {
public static void main(String[] args) {...
分类:
编程语言 时间:
2015-05-29 10:11:29
阅读次数:
147
头文件:
#pragma once
#include
#include
using namespace std;
template
class CQueue
{
public:
CQueue(size_t sz = INIT_SZ);
~CQueue();
public:
bool full()const;
bool empty()const;
void show()c...
分类:
编程语言 时间:
2015-05-29 10:10:46
阅读次数:
208
一、Mapper类的实现
/**
* KEYIN 即k1 表示行的偏移量
* VALUEIN 即v1 表示行文本内容
* KEYOUT 即k2 表示行中出现的单词
* VALUEOUT 即v2 表示行中出现的单词的次数,固定值1
*/
static class MyMapper extends Mapper{
protected void map(LongWr...
分类:
其他好文 时间:
2015-05-29 10:09:21
阅读次数:
179
1.新建一个java工程做服务器public class MyServer {
String str ;
public MyServer(){
try {
//服务器端的声明用serversocket,括号里面写端口号,端口号是自己指定的
ServerSocket ss = new ServerSocket(4700...
分类:
移动开发 时间:
2015-05-29 10:08:42
阅读次数:
115
在项目开发中,可能经常遇到嵌套ListView、ScrollView的问题,百度一搜,都是现成的代码,而且都是一样的,就是重写onMeasure方法,但是为什么要那么写,估计就没多少人知道了,这里进行深入的剖析一下下,重点看onMeasure方法,代码如下:/**
* Created by hailonghan on 15/5/28.
*/
public class ExpandListView...
分类:
其他好文 时间:
2015-05-29 10:08:24
阅读次数:
302
一、Mapper类的实现
static class MyMapper extends Mapper{
protected void map(LongWritable key, Text value, org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException ,InterruptedException {...
分类:
其他好文 时间:
2015-05-29 10:06:31
阅读次数:
118
关于泛型限定:
向上限定。意思就是说只能传递E类型以及E类型的子类;
代码:
package itheima;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* 泛型限定
* @author Administrator
*
*/
public class Gene...
分类:
其他好文 时间:
2015-05-29 10:03:16
阅读次数:
123
public class Solution { public int maximalRectangle(char[][] matrix) { if (matrix == null || matrix.length == 0) { return 0; ...
分类:
其他好文 时间:
2015-05-29 09:52:28
阅读次数:
104