摘要: wowAC 主要是LeetCode题解和基础算法课程。总体还是比较专业,很值得收藏。 阅读全文
posted @ 2017-12-30 15:44 xing-xing 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 10. Regular Expression Matching Description Implement regular expression matching with support for '.' and ' '. 思路: 我们采取回溯法来解决这个问题,首先我们定义函数match(i, j) 阅读全文
posted @ 2017-09-13 23:39 xing-xing 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 4. Median of Two Sorted Arrays Description There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted 阅读全文
posted @ 2017-09-11 23:37 xing-xing 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 3. Longest Substring Without Repeating Characters Description Given a string, find the length of the longest substring without repeating characters. E 阅读全文
posted @ 2017-09-11 12:00 xing-xing 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1. Two Sum Description: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that 阅读全文
posted @ 2017-09-11 10:34 xing-xing 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Thinking in Java(7) 1.1 Java工厂模式(不适用匿名类) 1.2 使用匿名类的实现 注意将工厂构造函数设为私有, 个人觉得这种方式很优雅 阅读全文
posted @ 2017-09-04 21:32 xing-xing 阅读(2362) 评论(0) 推荐(0) 编辑
摘要: Thinking in Java(6) 1.1 Readable接口简单应用 如果一个类继承了readable接口并实现了read方法,我们就可以使用scanner类来进行操作。read方法返回小于0的数表示没有可以读取的,s.hasNext就会退出,简单示例如下。 import java.io. 阅读全文
posted @ 2017-09-04 15:12 xing-xing 阅读(1643) 评论(0) 推荐(0) 编辑
摘要: Thinking in java(5) 1. 策略模式 2. 使用接口复用类 ProcessorI.java ApplyI.java ProcessString.java 1.3 适配器模式 实际中碰到的大多数类我们都无法修改,因此我们可以采取适配器模式 ProcessorI.java ApplyI 阅读全文
posted @ 2017-09-04 15:11 xing-xing 阅读(757) 评论(0) 推荐(0) 编辑
摘要: Thinking in Java(4) 访问权限控制 访问权限从大到小排序 public protected 缺省(包访问权限) private public什么情况都能互相访问 protected不在同一包的不用类不能访问其余(同一包中的类(包括子类和非子类), 不同包中的子类)都可以访问 缺省( 阅读全文
posted @ 2017-09-03 12:22 xing-xing 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Thinking in Java(3) 1. 可变参数列表 1.1 使用Object数组参数 最后一个结果,如果java类没有实现toString()方法的话,那么默认输出类名和地址。 1.2 使用可变参数列表 从上面可以看出,可变参数列表可以为空。 阅读全文
posted @ 2017-09-02 22:39 xing-xing 阅读(231) 评论(0) 推荐(0) 编辑