摘要: Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Only one letter can be ... 阅读全文
posted @ 2014-07-01 23:54 Awy 阅读(213) 评论(0) 推荐(0)
摘要: 抽象工厂模式(Abstract Factory),提供一个创建一系列相关或相互依赖对象的接口,而无需指定它们具体的类。 AbstractProductA和AbstractProductB是两个抽象产品,之所以抽象,是因为他们都有可能有两种不同的实现,而ProductA1、ProductA2和Pro... 阅读全文
posted @ 2014-07-01 16:25 Awy 阅读(225) 评论(0) 推荐(0)
摘要: 观察者模式又叫发布-订阅(Publish/SubScribe)模式定义了一种一对多的依赖关系,让多个观察者对象同时监听某一主题对象。这个主题对象在状态发生变化时,会通知所有观察者对象,使他们能够自动更新自己。 #include #include using namespace std;/*Obse... 阅读全文
posted @ 2014-07-01 10:55 Awy 阅读(279) 评论(0) 推荐(0)