摘要: 适用性 参与者 类图 例子 Target Adaptee Adapt*r Client result 1.2.2 桥接模式 适用性 参与者 类图 例子 Abstr*ction RefinedAbstraction Implemento* ConcreteImplemento* Test result 阅读全文
posted @ 2018-10-04 17:04 一起_007 阅读(76) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; typedef struct QNode { int data; struct QNode * next; }QNode,*QueuePtr; typedef struct { QueuePtr front; QueuePtr rear; }LinkQueue; bool init(LinkQueue & L) { ... 阅读全文
posted @ 2018-10-04 09:52 一起_007 阅读(48) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #define STACK_INIT_SZIE 100 #define INCREAMENTSIZE 10 typedef struct { int * base, *top; int stacksize; }Stack; bool init(Stack & S) { S.base = (int *)malloc(STA... 阅读全文
posted @ 2018-10-04 09:16 一起_007 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 1.1 创建型模式 AbstractFactory ( 抽象工厂 ) FactoryMethod ( 工厂方法 ) Singleton ( 单态模式 ) Builder ( 建造者模式 ) Protot*pe * 原型模式 ) 1.1.1 工厂方法 适用性 参与者 类图 例子 product Con 阅读全文
posted @ 2018-10-03 21:47 一起_007 阅读(203) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #define MAX 100 typedef struct { int date; int cur; }component, slink[100]; void init(slink L) { int i; L[MAX - 1].cur = 0;//最后一个节点,相当于是一个头节点,然后,将他指向下一个的下标设为0,也就类... 阅读全文
posted @ 2018-10-03 17:47 一起_007 阅读(77) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; typedef struct LNode { int data; struct LNode * next; }LNode, * Listlist; //bool init(Listlist & L,int i) //尾插法 //{ // LNode *new_node, *temp_node; // temp_node = L... 阅读全文
posted @ 2018-10-02 16:19 一起_007 阅读(72) 评论(0) 推荐(0) 编辑