Happiness is more than pleasure without pain

你只有非常努力,才能看起来毫不费力

导航

2015年3月27日 #

快排

摘要: package com.algorithm;public class Sort {public static void main(String []args){int []a={4,4,5,7,1,8,3,9,11,6};qsort(a,0,a.length-1);for(int i=0;im)j-... 阅读全文

posted @ 2015-03-27 21:37 believer 阅读(153) 评论(0) 推荐(0) 编辑

Single Number II

摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp... 阅读全文

posted @ 2015-03-27 19:18 believer 阅读(141) 评论(0) 推荐(0) 编辑

简单工厂和工厂方法

摘要: 简单工厂:一个工厂类根据传入的参量决定创建出哪一种产品类的实例直接一个工厂类,内部通过swith(operator) { case"+": oper=new AddOperation();//产生对象 ...而工厂方法模式:定义一个用于创建对象的接口,让子类决定实例化哪一个类。工厂方法使一个类的... 阅读全文

posted @ 2015-03-27 16:28 believer 阅读(121) 评论(0) 推荐(0) 编辑

Implement strStr()

摘要: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02):The si... 阅读全文

posted @ 2015-03-27 13:50 believer 阅读(138) 评论(0) 推荐(0) 编辑