上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
  2017年9月3日
摘要: 安装 1 安装jdk 2 下载解压maven 3 配置环境变量path 4 输入mvn –v 检测是否安装成功 配置 1 全局文件配置: %MAVEN_HOME%/conf/settings.xml 是maven全局的配置文件。 该配置文件中配置了本地仓库的路径,默认就是:~/.m2/reposit 阅读全文
posted @ 2017-09-03 23:44 wheleetcode 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 概述: 在软件开发中经常遇到类似的情况,实现某一功能有多种算法或者策略,我们可以根据环境或条件的不同选择不同的算法或策略来完成功能。如查找、排序等,一种常用的方法是硬编码(Hard Coding)在一个类中,如需要提供多种查找算法,可以将这些算法写到一个类中,在该类中提供多个方法,每一个方法对应一个 阅读全文
posted @ 2017-09-03 22:00 wheleetcode 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 概述: 一个对象的状态在对象被创建之后就不再变化,这就是不变模式 弱不变模式:一个类的实例状态是不可变的,但这个类的子类的实例具有可能会变化的状态,实现弱不变性满足的条件: 1 对象没有任何方法修改对象的状态 2 对象的属性私有,客户端会对公开属性修改 3 对象所引用对象变化的话,必须限制外界对可变 阅读全文
posted @ 2017-09-03 21:35 wheleetcode 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 概述: 将抽象性化与实现化脱耦,使二者可以独立的变化。 耦合就是两个实体行为的某种强关联,将强关联去掉,或将强关联变为弱关联就是脱耦。 强关联就是在编译时期已经确定,无法在运行时期动态改变的关联。弱关联就是可以动态确定并且可以在运行时期动态改变的关联,继承关系是强关联,聚合关系是弱关联。 将两个角色 阅读全文
posted @ 2017-09-03 16:41 wheleetcode 阅读(143) 评论(0) 推荐(0) 编辑
  2017年9月2日
摘要: 1 Find Peak Element public int findPeak(int[] a) { // write your code here if (a == null || a.length <= 2) return -1; int start = 0; int end = a.lengt 阅读全文
posted @ 2017-09-02 11:59 wheleetcode 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1 Two Sum public int[] twoSum(int[] numbers, int target) { int[] res = {-1, -1}; if (numbers == null || numbers.length < 2) { return res; } Map<Intege 阅读全文
posted @ 2017-09-02 10:54 wheleetcode 阅读(95) 评论(0) 推荐(0) 编辑
  2017年9月1日
摘要: 两根指 针1. 一个数组,从两边往中间移动(对撞型)2. 一个数组,同时向前移动(前向型)3. 两个数组(并行型) 对 撞型或者相会型 Two sum 类 和 Partition 类 1 Two Sum public int[] twoSum(int[] numbers, int target) { 阅读全文
posted @ 2017-09-01 14:28 wheleetcode 阅读(169) 评论(0) 推荐(0) 编辑
  2017年8月31日
摘要: Union Find 集合合并,查找元素在集合里面 数组实现 int[] pre; public int find(int x) { int r = x; while (r != pre[r]) { r = pre[r]; } int i = x, j; while (pre[i] != r) { 阅读全文
posted @ 2017-08-31 11:51 wheleetcode 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 动态规划空间优化 滚动数组 1 House Robber public long houseRobber(int[] a) { if (a == null || a.length == 0) { return 0; } if (a.length == 1) { return a[0]; } if ( 阅读全文
posted @ 2017-08-31 09:32 wheleetcode 阅读(184) 评论(0) 推荐(0) 编辑
  2017年8月28日
摘要: Matrix DP 1 Triangle public int minimumTotal(int[][] triangle) { if (triangle == null || triangle.length == 0) { return 0; } if (triangle.length == 1) 阅读全文
posted @ 2017-08-28 17:37 wheleetcode 阅读(140) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页