外观模式,用来为复杂的子系统提供简单易用的高层接口。如果你发现调用某个子系统实现一个简单的功能也需要调用很多个低层组件,那么你可能需要外观模式来拯救你。
分类:
其他好文 时间:
2014-09-16 14:09:00
阅读次数:
149
解释器模式(Interpreter Pattern)...
分类:
其他好文 时间:
2014-09-16 01:37:49
阅读次数:
322
Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The...
分类:
其他好文 时间:
2014-09-15 21:14:39
阅读次数:
190
这题类似
Regular Expression Matching,但是数据比较强。
首先介绍DP的解法,回忆Regular Expression Matching,我们也用dp(i,j)表示s[0...i-1]和p[0...j-1]是否匹配
基本情况相似,但是更简单:
1. dp(0,0) = true
2. dp(0,j) = dp(0,j-1) && p[j-1] == '*‘...
分类:
其他好文 时间:
2014-09-15 17:54:29
阅读次数:
221
即使你认为自己已对 MySQL 的 LEFT JOIN 理解深刻,但我敢打赌,这篇文章肯定能让你学会点东西!ON 子句与 WHERE 子句的不同一种更好地理解带有 WHERE ... IS NULL 子句的复杂匹配条件的简单方法Matching-Conditions 与 Where-conditio...
分类:
数据库 时间:
2014-09-15 17:36:29
阅读次数:
302
1.11 F'ibonates函数的变种,略过。1.12题目:The following pattern of numbers is called Pascal's triangle. 1 1 1 1 2 1 1 3 3 11 4 6 4 1.......
分类:
其他好文 时间:
2014-09-15 17:25:09
阅读次数:
227
一、引言 在上一篇文章介绍到可以使用状态者模式和观察者模式来解决中介者模式存在的问题,在本文中将首先通过一个银行账户的例子来解释状态者模式,通过这个例子使大家可以对状态者模式有一个清楚的认识,接着,再使用状态者模式来解决上一篇文章中提出的问题。二、状态者模式的介绍 每个对象都有其对应的状态,而每.....
分类:
其他好文 时间:
2014-09-14 20:45:08
阅读次数:
320
The string "PAYPALISHIRING" is
written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S I ...
分类:
其他好文 时间:
2014-09-13 22:52:36
阅读次数:
209