上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 先来说说代理模式(静态代理): 其为23种设计模式之一,属于结构型模式,其主要思想是通过一个代理对象来代替真实对象来响应client的调用或请求。静态代理要求代理类与真实类实现一个共同的接口,这样代理对象才能在“型”上代替真实对象。类图如下: 一个通过代理模式来代理并增强真实对象的简单示例: 代理模 阅读全文
posted @ 2015-07-15 20:34 Mr.do 阅读(181) 评论(0) 推荐(0) 编辑
摘要: HashMap的系统介绍: HashMap实现了Map接口(注意:map类容器都没有实现Collection接口,只有set,list这类的容器才实现Collection),其对一般的基本操作(put,get,contains)能够保证常数时间,当然前提是hash function能让各个key分布 阅读全文
posted @ 2015-07-12 20:51 Mr.do 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 所谓泛型,就是指编程语言中能够编写出更加“通用”、“泛化”的代码。希望能利用泛型,编写出一个能处理各种各样类型对象实例的处理过程代码。 首先,考虑下面一段通用代码: 在java se5之前,很多代码可能就是这样编写的,但java引入了泛型之后: 对比上面的两段代码,发现使用泛型时,java主要多做了 阅读全文
posted @ 2015-07-07 16:22 Mr.do 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2-> 阅读全文
posted @ 2015-07-01 14:38 Mr.do 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo 阅读全文
posted @ 2015-06-30 11:25 Mr.do 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECO 阅读全文
posted @ 2015-06-29 20:44 Mr.do 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j]  阅读全文
posted @ 2015-06-28 20:18 Mr.do 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array such that nums[i] = nums[j] an 阅读全文
posted @ 2015-06-28 09:53 Mr.do 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2015-06-28 09:28 Mr.do 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Find Minimum in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose 阅读全文
posted @ 2015-06-27 11:19 Mr.do 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页